5

i'm using windows xp what would be a good c compiler? i want to learn c so that i can better understand the objective-c language for the iphone. i have a great background in php so hopefully something will make sense

ps:

what sections should i put more focus on when learning c in getting prepared for objective-c?

thanks

Duplicate:

Community
  • 1
  • 1
  • Possible duplicate of [C compiler for Windows?](http://stackoverflow.com/questions/116368/c-compiler-for-windows) – Mureinik Jan 16 '16 at 16:33

14 Answers14

13

GCC is a free, open source, high quality, compiler. You can get it with cygwin.

Microsoft makes a C compiler that comes with Visual Studio, which is Microsoft's integrated development environment. You can download the "Express" edition of Visual C++ to give it a try.

Also, Intel makes a good compiler.

Himadri Choudhury
  • 10,217
  • 6
  • 39
  • 47
8

The iphone uses the gcc compiler. This is available for windows using MinGW/MSYS or other compatibility packages.

Apple has Objective-C tutorials which assume very little C experience; I'd be tempted to just dive in. If you get stuck, then get K&R. (I don't know if php has types and pointers, otherwise you'll get stuck straight away)

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
Pete Kirkham
  • 48,893
  • 5
  • 92
  • 171
6

Visual C++ express is free, has a really nice IDE and compiles C code.

Laserallan
  • 11,072
  • 10
  • 46
  • 67
  • The question doesn't state that he's looking for an Objective C compiler. He's looking for a C compiler to understand Objective C better. – Laserallan Feb 24 '09 at 10:26
2

I'd use gcc by downloading cygwin.

Lehane
  • 47,588
  • 14
  • 53
  • 53
2

Gcc is the way, you can install mingw which is a native windows port.

Marko
  • 30,263
  • 18
  • 74
  • 108
2

I also recommend gcc, but don't get too used to GNU extensions such as asprintf() if you want to write portable code. On some systems, strdup() is lacking, amongst many others. The compiler itself won't spoil you, but glibc will.

On the one hand you have POSIX, on the other hand you have ISO/c89/c99, then you have gcc.

I highly recommend gcc, with the above warnings in mind while you continue to explore other compilers. For instance, it can be fun to code around the limits of Lestes if you enjoy dabbling in C++.

In any event, gcc is very powerful, boasts superior optimizations and can be so -pedantic that you think its out to get you. But, don't forget about portable code .. or where/if portability kludges are actually appropriate.

Cygwin is also highly recommended, as DasBoot posted.

Tim Post
  • 33,371
  • 15
  • 110
  • 174
  • **Very** few platforms will be without strcpy() and, even for those, it can be built out of strlen(), malloc() and strcpy(). – paxdiablo Feb 24 '09 at 10:40
  • And you want to stop writing something that uses it in order to implement it yourself because ... ? – Tim Post Feb 24 '09 at 10:56
  • Thinking more, I have spent too much time working on operating systems without a modern C library .. I'm probably over-defensive. – Tim Post Feb 24 '09 at 10:57
2

You could have a look at this free e-book Programming in C in 7 days as a starter where they use Dev-CPP for windows

Note

It includes only the first 7 lessons of the more complete e-book “Quickly Learn Programming in C”

epatel
  • 45,805
  • 17
  • 110
  • 144
2

Normally I would recommend Pelles C for programming C in windows. It is a good user friendly programming environment that has the best c99 compliance that i've seen... However, here I'm going to tell you that you should use gcc right off but not on windows. Use Linux (maybe Ubuntu?).

The reason I say to use gcc on Linux is because you want to develop for the iphone. I would suggest getting comfortable with the tools you are likely to use. I don't imagine you using the official iphone sdk (you'd need a Mac for that) so I think you'll be using the free tool chain. It does not compile on windows so switch to a supported platform and get comfortable with the tools.

nabiy
  • 359
  • 2
  • 4
1

I personally recommend MinGW. You can download it off SourceForge. It even works on a 64 bit configuration. I don't think it supports objective C. However, I found it useful while running C code on windows.

I don't have any idea about objective C and what parts of C you need to focus on while learning so as to make the transition easy. I'll leave that to someone with more experience.

batbrat
  • 5,155
  • 3
  • 32
  • 38
1

gcc included in cygwin is a perfect first choice if you want to learn C on your Window XP platform. cygwin/gcc includes a basic Objective-C environment.

Anyway if you want to target iPhone, the best move would be to change to a Mac platform (which can natively run XP for smoothing the switch) in order to get Xcode, the Mac and iPhone development environment. You will also be able to learn CocoaTouch, the iPhone OS.

In parallel, you can register to the iPhone Dev Center for accessing all resources for learning iPhone programming.

mouviciel
  • 66,855
  • 13
  • 106
  • 140
1

If you're after a compiler that can compile both C and Objective-C, a GCC port to Windows is probably your best bet.

Timo Geusch
  • 24,095
  • 5
  • 52
  • 70
1

When learning C, concentrate on pointers, arrays, strings and memory management - those are the things that will trip you up coming from a managed environment of any kind.

Jim T
  • 12,336
  • 5
  • 29
  • 43
0

The best thing about gcc is that it has a lot of features and supports the latest language standard. But for fast compilation and a nice programming environment you can't beat Lcc-Win32.

Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
0

GCC is the cheapest compiler, Intel the fastest, MSVC the most featured.

Crashworks
  • 40,496
  • 12
  • 101
  • 170