Sunday, August 2, 2009

C programming for dummies is confusing me!?

Ok I thought that you typed the C code into a compiler like Visual 2008 and edit it in there and then use the program to compile it rite?





this book is saying something like using Ms-dos to edit the text and then its telling me to make a GCC batch file and stuff ? ("Windows compilers aren’t designed to be friendly for command-line compiling.


Because of that, it’s up to you to make the compiler work at every command


prompt and in every folder in your computer system. One way to make


that happen is to create a batch file that runs the GCC (or whatever) command


that runs the compiler.")





now im gettin confused.. Why do I need to do all that?

C programming for dummies is confusing me!?
If you're just learning how to use C, I wouldn't recommend getting started on a Windows platform. If you can get access to a Unix or Linux system, compiling C or Java applications is easy to do and the way I first learned how to compile and execute programs. I have tried to compile C programs on Windows and it just sucks. Its even frustrating for me and I KNOW how to compile stuff. I cant help you with your problem, but I can only tell you from experience that if you want to learn C or Java, start using a Unix or Linux system because you avoid all this crap that you're running into.
Reply:All code editors are really text editors. At their most basic functionality, you enter text into a file, and hopefully you followed the correct syntax so that when you feed that text file into the compiler it doesn't complain. On Unix, it is common for you to use another program, like Vi to write the text (Vi is a poor man's DOS-like notepad) and then use GCC from the command line to compile the program. This can be frustrating for those not used to a command line, but this is perfectly normal. In fact, Visual Studio is using a command line compiler. The compiler is a separate DOS-like program; when you tell Visual Studio to build it is generating a large command prompt for this program, executing it, and logging its feedback. This is all transparent to you, giving you the impression that Visual Studio alone is compiling the files, when in reality the C compiler is just like GCC, a separate, minimal program that strictly exists to compile C code into an executable. Visual Studio project files are nothing more than a proprietary 'make' (or batch) file format. So really, the advantage with Visual Studio is you get a graphical interface that lets you make logical choices rather than having to script the functionality for a tool like 'make'.
Reply:ok.. first of all, what is your c compiler? i use turbo c, and well, its not that hard to understand. The msdos-editing is a turbo c job(i think), cause turbo c is programming in ms dos. I think the gCC is used after you have created or compiled all your c code...





tip: dont rely on books for dummies... Not all of the books are easy to understand..
Reply:try this one


http://www.amazon.com/Complete-Idiots-Gu...


No comments:

Post a Comment