it's been a while since I think about starting to programming in C and after that to learn programming in C# and I search a lot on google but couldn't find a good guide to start learning base programming in C .However I found that Eclipe integrates very good with Ubuntu and it's a good programming environment for starting to program in C but somebody can give please some links with guides or tell me where can I find the bases for starting to program in C ,and I mean good base because I found a lot of incomplete guides over google ? And if I don't ask to much please give some tips of how to start and how to use Eclipse.Every help will be welcome ,thanks.
-
2This isn't really Ubuntu specific. Just head into your local library and pick up a non-fiction book on C. While I don't think Stack Overflow will appreciate requests for tutorials, you are welcome to search around there, and ask for help with specific, concrete questions. Do be warned that I feel as if the site is unfriendly to newer users.– nanofaradOct 22, 2012 at 22:46
-
1Try en.wikibooks.org/wiki/C_Programming and for reference the detailed gnu.org/software/gnu-c-manual/gnu-c-manual.html– user76204Oct 22, 2012 at 23:11
-
1But surely we can show how to configure Ubuntu to be able to compile C programs and how to write, compile and run a minimal C program in Ubuntu? I think it's a good question.– SergeyOct 22, 2012 at 23:38
-
1This may help you: stackoverflow.com/questions/562303/…– Dielson SalesOct 23, 2012 at 0:10
2 Answers
You do not need to complicate things with Eclipse and stuff if you want to learn C (which is also an interesting choice of a first programming language... while not discouraging you, I'm curious about your motives). I think it would be much more useful to learn how all the low-level bits (source code, compiler, headers, libraries, debugger, makefiles) fit together and then, if you want, to transition to an IDE.
From the Learn C the Hard Way book linked by Goddard:
An IDE, or "Integrated Development Environment" will turn you stupid. They are the worst tools if you want to be a good programmer because they hide what's going on from you, and your job is to know what's going on. They are useful if you're trying to get something done and the platform is designed around a particular IDE, but for learning to code C (and many other languages) they are pointless.
You surely don't need Eclipse to write a "Hello, World" program in C. First install stuff needed to compile programs:
sudo apt-get install build-essential
then open a text editor and type something like
#include <stdio.h>
int main() {
printf("Hello, World\n");
return 0;
}
save the file as hello.c
. In terminal, run
gcc hello.c -o hello
you'll find an executable file called hello
in the same directory. Run it:
./hello
It prints "Hello, World". Magic! Now get a book on C and try to modify the program to do something interesting.
A good book to add to Sergey's answer is listed below. This is the recommended route to go for a fresh developer. The Ubuntu/Linux development world is bitter sweet. A big learning curve in my opinion, but once you learn it the world is open and free for the most part.
This is a good resource http://c.learncodethehardway.org/book/
-
Thank you all very much ,the reason why I want to start programming is because I really like Gnu/Linux Open Source Sytems and I would like in future to contribute for Ubuntu development but to do that U have to know the basic programming and I don't want to switch to windows for learning that, I want to do it in Ubuntu that's why I asked the question,Thanks again you all :D Oct 23, 2012 at 0:13