I am new to C and I literally mean new. I just bought a book and am in Chapter 1. To do any pogramming, however, will need a C compiler. Does anyone have any recommendations on a good choice for one? Thank you. Your help is appreciated.
I am new to C and I literally mean new. I just bought a book and am in Chapter 1. To do any pogramming, however, will need a C compiler. Does anyone have any recommendations on a good choice for one? Thank you. Your help is appreciated.
VC++ on Windows or gcc on UNIX.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
Bloodshed Software - Dev-C++
Here's one at no cost, its a Windows front end for GCC/G++
HOPE YOU UNDERSTAND.......
By associating with wise people you will become wise yourself
It's fine to celebrate success but it is more important to heed the lessons of failure
We've got to put a lot of money into changing behavior
PC specifications- 512MB RAM, Windows XP sp3, 2.79 GHz pentium D.
IDE- Microsoft Visual Studio 2008 Express Edition
code::blocks is a better alternative to bloodshed
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
My #1 recommendation to newbies is to use a syntax highlighting text editor (eg, notepad++ on windows, or anything on linux) and then just use the compiler on the command line, and not an IDE like code::blocks.
Which is to say, you should understand that the compiler IS NOT a graphical program with menus and windows, etc, it is just a command:
gcc mycode.c
If you are on linux, you almost certainly want to use gcc. I don't program on windows, but I believe if you install Visual Studio, you can still use the compiler on the command-line:
How to: Invoke the Command-Line Compiler
Of course, if really want to use the "IDE" (integrated development environment) that is Visual Studio, you can. But IMO these things are intended to make things easier for the proficient, and not the beginner, for whom they will probably just be a complication.
Also, doing things "the old fashioned way" may give you some insight you would not get otherwise.
Just an opinion to make you aware of the alternatives
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Just wanted to third this. While I use VS when developing on Windows, to just view code quickly I use whatever syntax-highlighting editor I happen to have around, and that's usually SciTE.
Using an IDE makes it more convenient to step through your code in the debugger, as the debugger can use the actual editor, instead of printing lines out of context.
It can also display the directory tree structure, which is convenient for a large project.
And most important for a beginner, it makes it easier to start, because it decides all the compiler flags for you, and you don't have to worry about make files.
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.
Fourthed.Just wanted to third this. While I use VS when developing on Windows, to just view code quickly I use whatever syntax-highlighting editor I happen to have around, and that's usually SciTE.
Elysia will jump in any second now .
I use SciTE and Dev-C++ on Windows (though if I had to write any major projects I think I'd use Code::Blocks). And vim and KDevelop with gcc/g++ on Linux.
For what it's worth: SourceForge.net: Integrated Development Environment - cpwiki
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Sigh. Damn command-line inVOkers. Evil, anti-noob unfriendly.
Go with a real IDE that handles everything for you. Visual Studio is one such.
One button to compile all your source files, no worrying about command line flags and stuff. Default settings are fine (although warning level really should be raised).
I think that command-line is orders of magnitude easier that Visual Studio. It was so difficult to figure out and memorize those menus, that I just couldn't take it. I actually never figured out debuggers, linking, libraries but when I got Linux and gcc/gdb, it was a piece of cake!
You *WILL* Learn C Faster And Painlessly With Command Line Tools! (and Linux really helps)
What would you rather do:
Not being able to figure out having multiple source files, or just type a list of your files.
Go through tedious senseless menus and find some obscure files, or just type the name or you library!
Have this big folder with project files and all these pointless directories, or just a source file and and output file!
Having trouble figuring out debug and release mode, here just type a key.
In fact Visual Studio was so difficult, that I quit C/C++. When I got Linux, and heard it has "gcc" in it, I can finally write C painlessly!
Last edited by MTK; 09-18-2009 at 06:29 PM.
That's a double negative. So I see you agree.Evil, anti-noob unfriendly.
The problem with just need to press a button is... finding where the button is.
I'd say "gcc a.c" is easier. Even if you can't figure that out yourself, "gcc --help" as per the UNIX conventions will give you a 54 lines short help. The first line of which says
and this is also following the conventions.Usage: gcc [options] file...
Of course, I am assuming the user is familiar with the command line. Note that being a C newb isn't the same thing as a computer noob. In fact, most aren't. And most true computer-not-noobs are at least comfortable with the command line (even if they don't prefer it).
What you said could be true if the person is deathly afraid of the command line, but it has nothing to do with command line compilation being more difficult.
It's like saying riding a bike is more difficult than driving a car because you can't ride a bike.