23

Taking advice from this post, I purchased a copy of 'The C Programming Language' and am happily reading my way through.

However, all the stuff I've written in the past has been interpreted, and I have no idea where to look for a good C compiler or an IDE (is there even one?). Google searches throw up a lot of results for C++ compilers, which I don't think is the same thing? Haha. I was wondering if there is a compiler or IDE for C that's regarded as an industry standard (kinda in the same way that Zend Studio is pretty much the IDE for PHP), or at least one that is generally considered to be a good quality product.

Robert Harvey
  • 178,213
  • 47
  • 333
  • 501

16 Answers16

15

I'm surprised no-one's mentioned Pelles C. Great little C IDE for Windows; includes an LCC-based compiler. That said, NetBeans 6.5 has decent support for C and C++, and Code::Blocks is well worth a whirl.

Rob
  • 47,999
  • 5
  • 74
  • 91
13

Well, Visual Studio is the standard on Windows, and there are free versions available. However it does have a bunch of Microsoft specific extensions. For learning though, developing console apps are pretty easy and also fairly close to the standard K&R style C.

However, way back in the day I used to use Watcom, which was also pretty good for the time. It's a lot more sparse than Visual Studio, but that can be an advantage for a beginner. I believe it's also available for free these days at http://www.openwatcom.org/index.php/Main_Page

I'd probably recommend starting with that, if your main O/S is Windows.

Edit: new live url

Nilabja
  • 4,206
  • 5
  • 27
  • 45
Andrew Rollings
  • 14,340
  • 7
  • 51
  • 50
11

Most people use Microsoft Visual Studio for development on Windows. You can get a free version here: http://www.microsoft.com/express/download/.

Usually GCC is used on Unix, and is typically included with the OS.

C and C++ are very similar, but C++ allows classes. Most C++ compilers will compile C code.

Excel Kobayashi
  • 578
  • 1
  • 6
  • 19
  • 8
    Careful C is NOT a subset of C++ (there are some things in C that won't work on a C++ compiler). So if you want to do true C, you can't use a C++ compiler. – BIBD Dec 03 '08 at 18:13
  • 2
    C and C++ are in certain sense similar, but there are important and fundamental differences you have to know or you will run into trouble. – JesperE Dec 03 '08 at 18:20
  • 3
    I didn't say any of those things. I said most C++ compilers will compile C, which is true, even if they use things in C that don't work in C++. – Excel Kobayashi Dec 03 '08 at 18:22
  • This doc has some good discussions on the differences between C and C++, http://www.research.att.com/~bs/3rd_compat.pdf – BIBD Dec 03 '08 at 18:23
  • 2
    Just as an aside, thealliedhacker isN't saying that C and C++ are the same or subsets or whatever. For instance, the Visual Studio C++ kit comes with a C compiler as well. If you write a C source file, it will happily compile C-only things. – Jason Coco Dec 03 '08 at 18:28
  • 1
    CodeSlave: No one said anything about using a C++ compiler. MSVC++ contains both C and C++ compilers. – jalf Dec 03 '08 at 18:33
  • 3
    Every C++ compiler I've ever come across can also compile C - in fact, by default they'll use C language rules if the source file has a .c extension. However, the reverse obviously is not true - there are plenty of C compilers that don't know squat about C++. – Michael Burr Dec 03 '08 at 19:05
  • I agree that there are compilers that can compile both c and c++ (gcc). It's safe so long as the compiler is smart enough to behave appropriately for each kind of source file. My caution comes from seeing c text books with wrong examples where the author (wrongly) used a c++ compiler to test them. – BIBD Dec 03 '08 at 19:06
  • 2
    C is not a subset of C++. C++ is not a superset of C. Visual Studio's C compiler is rubbish and does not support C99. – Miles Rout Jan 01 '13 at 00:03
7

I used DevC++ almost exclusively while I was in University for C\C++ programming. It comes bundled with the MinGW compiler. It's pretty easy to get set up and rolling. Other than this, my only other recommendation would be Visual Studio.

Matthew Ruston
  • 4,282
  • 7
  • 38
  • 47
5

GCC (GNU Compiler) and vi/emacs (or pico for uber-newbies)

Addendum: remember C is NOT a subset of C++, so a c++ compiler is not necessarily appropriate.

BIBD
  • 15,107
  • 25
  • 85
  • 137
  • Oh man, I am not going anywhere near Vi again :P –  Dec 03 '08 at 18:07
  • I guess emacs it is then (although I think that vi is easier to learn). Trust me, it's faster to edit a txt file in vi than than almost any IDE. – BIBD Dec 03 '08 at 18:16
5

Almost all C++ compilers will compile C code.

I would recommend using Microsoft Visual Studio. There is a free version of it.

Most C programmers like to have their own editor and choose a compiler that fits their project. That is why you can download multiple different compilers for C and not so many built into IDE's directly.

It is easy to use editors like Editplus or even Notepad. Some of the fancier editors have syntax highlighting and can run commands in a command window for you.

IDE's usually support multiple languages as well. So when you are tired of C and want to move on to Python, Java, C++, some IDE's can help you do that. I would look into these:

Jeremiah
  • 5,386
  • 9
  • 38
  • 45
5

I recommend Quincy when you are just learning to program in C/C++. Simple to use and created for easily trying out small C/C++ programs.

Suraj
  • 4,717
  • 1
  • 18
  • 12
5

You can download the Digital Mars C compiler for Windows for free.

Walter Bright
  • 4,277
  • 1
  • 23
  • 28
3

Another good IDE is CodeBlocks, and its cross platform. Give it a try you might like it. I used it for a while an it gave me good results for what i was doing ( an image editor in C ), but it had some bugs.

For unix developing i've always liked using gcc plus an editor... it just makes it fun ( after you get use to it ).

Alan Featherston
  • 1,086
  • 3
  • 14
  • 27
3

When it comes to c/c++ compilers on the Windows platform there are quite a few to choose from.

And when it comes to and IDE, the Zeus IDE can be easily configured to work with any of them.

jussij
  • 10,370
  • 1
  • 33
  • 49
2

I used DevC++ when learning C years ago. It was a great tool, although I haven't seen it in a while so I'm not sure what state it is in now.

http://www.bloodshed.net/devcpp.html

Eric
  • 464
  • 3
  • 7
1

For the record, I used TCC, the Tiny C Compiler, to quickly test small code. It can generate exe and DLLs.
You might need to download the Windows headers: it has a limited subset, you might want more.

Digital Mars also has a free C/C++ compiler of reasonable size.

PhiLho
  • 40,535
  • 6
  • 96
  • 134
1

GNU C is pretty much an industry standard, even if its a unixy compiler. You can also use Visual Studio, but keep in mind it doesnt support C99 very well. Other choices are out there, like pcc (I really like this one), llvm (also very interesting), etc, but those usually require some level of enthusiasm.

ahoka
  • 21
  • 2
1

The free country website has a list of free C compilers. Many of which work on Windows.

Slapout
  • 3,759
  • 5
  • 40
  • 61
0

You could use a C++ compiler, such as gcc, to compile your C code. Here's a good article with links to free C compilers/IDEs:

http://computerprogramming.suite101.com/article.cfm/freeprogrammingtools

Ricardo Villamil
  • 5,031
  • 2
  • 30
  • 26
  • Isn't gcc a C compiler? I think you were refering to g++ – AntonioCS Dec 04 '08 at 22:53
  • From the GCC manual: The abbreviation GCC has multiple meanings in common use. The current official meaning is “GNU Compiler Collection”, which refers generically to the complete suite of tools. The name historically stood for “GNU C Compiler”... – Michael Burr Dec 05 '08 at 20:30
0

Simply because the white book is influential, doesn't mean it's a good learning resource!

It is possibly the worst way to learn a language from that has ever existed. On top of that, last time I checked it was unreasonably expensive.

It's a complete language definition, and is good at that (which is why it truly is one of the most influential programming books). For a long time it actually was THE definition of C.

You might consider a second book on the subject.

That said, you should try quite a few different IDEs and see what you are happy with.

In fact, at first you might want to get used to vi/emacs/notepad/make and command-line compiling, this will get you a much stronger understanding of your environment (and if it's not understanding you're after, then you are barking up the wrong language-tree).

As you are investigating different IDEs, I'd give Eclipse or Netbeans with a c plugin a try. They are going to be the most complete and reliable IDEs (except, probably, for Microsoft's) and are platform independent so you won't be left in the cold when you decide to go to the Mac or Linux.

Bill K
  • 62,186
  • 18
  • 105
  • 157
  • Dunno, at least for me, it's easier to learn a language form the language specification, after going through a very very quick bootstrapping tutorial, but many "dry" specs include such a basic tutorial in the first chapter. – Tamas Czinege Jun 10 '09 at 15:25
  • I've got the book and learned from it many years ago. It's a reasonable language definition, but is a bare minimum. Pretty much the definition of "Reference" instead of "Training". I'm shocked that anyone would dispute this. ANY book you bought on c would be better for learning than the white book. I guess some people have to defend spending $60 on what is essentially a pamphlet. – Bill K Jun 10 '09 at 20:32
  • I don't know about that. My friend and I both had to learn C for an assignment.. He used one of the big Deitel&Deitel tomes, I was using the "white book". To be sure, the Deitel book hand-holds you more, but it's faster to read through and to use as a reference. Personally, although I don't like C too much, the book was a fine one. – Jean Azzopardi Aug 23 '09 at 01:48