Posted: Wed Jan 02, 2008 10:04 am Post subject: Help learning C and choosing a complier
Hey everyone, Happy late new year.
I am actually interested in learning pure C. I am going to need some help with picking out a C complier for XP. At the beginning of the tutorial, I am not understanding, that might be because I never tried programming. I will post up the output and I will also post up the tutorial link. At some point someone probably read the tutorial. It is from the cprogramming board.
c:
#include
<stdio.h>
int main() { printf("I am alive! Beware.\n");
getchar();
return0;
}
Posted: Wed Jan 02, 2008 10:14 am Post subject: RE:Help learning C and choosing a complier
You can try getting MinGW32. It's actually a crapload of compilers, but includes one for C. I'd also suggest that you make your include statement one line and PLEASE, this isn't very hard, use code tags.
php111
Posted: Wed Jan 02, 2008 10:20 am Post subject: Re: RE:Help learning C and choosing a complier
Mazer @ Wed Jan 02, 2008 10:14 am wrote:
You can try getting MinGW32. It's actually a crapload of compilers, but includes one for C. I'd also suggest that you make your include statement one line and PLEASE, this isn't very hard, use code tags.
This link is the closest I came to download it but I don't know which one to download it. I don't want to download the wrong one.
How do I make my statement of one line and how do I use tags? Yes I am sure I want to learn C. Then ASM.
md
Posted: Wed Jan 02, 2008 11:27 am Post subject: RE:Help learning C and choosing a complier
Well, you would make your include one line by not putting a newline after #include, so it looks like so
c:
#include <stdio.h>
Code tags make your code look like it that line just there does; you can either use [code][ /code] (without the space in the second) or [syntax="c"][ /syntax] for C code specifically (again without the space). You put your code between the two bits in brackets, example (again... remove the space...)
[code]int main(int argc, char **argv)
{
}
[ /code]
[syntax="c"]int main(int argc, char **argv)
{
}
[ /syntax]
Mazer
Posted: Wed Jan 02, 2008 4:41 pm Post subject: RE:Help learning C and choosing a complier
As for which version of MinGW32, I'll admit I had a hell of a time trying to figure it out myself last time. I suggest just going with the first download link on that page.
Junkhead
Posted: Thu Jan 03, 2008 6:48 pm Post subject: Re: Help learning C and choosing a complier
I recommend you go download wxDevcpp, which includes the MinGW compiler by default. It's what I use to port my linux games over to windows, and it works wonderfully.
It also includes a visual form designer, so you can make cross-platform GUI programs with ease.
As for your code, I strongly recommend you keep your preprocessor statements (statements beginning with a #) on one line only, because the preprocessor works on a line-by-line basis (as defined in the C standard). If you don't follow the standard, your code might not be portable across different compilers (which comes to be a _big_ problem later on).
But wxDevcpp would probably be better, becaue it is an editor and compiler, AKA IDE.
md
Posted: Thu Jan 03, 2008 7:28 pm Post subject: RE:Help learning C and choosing a complier
wxDevcpp seems like a poor way of learning the language. Forms and other GUI elements are library dependent and have nothing to do with the language. Likewise IDEs can very easily get in the way of learning.
If your going to learn anything I sugest finding a good syntax highlighting text editor (I use gedit on linux, there is surely something for windows) and a command line compiler. Then write some command like apps. GUIs are ALWAYS complicated and never a good thing for beginners to be doing.
Sponsor Sponsor
Junkhead
Posted: Fri Jan 04, 2008 3:36 pm Post subject: Re: Help learning C and choosing a complier
Ah, md is right, I was just thinking in terms of convenience though. I use gedit myself =) and gvim, which works great too (NOT recommended for beginners). On windows, it's harder to get a command line compiler set up and running though, since most windows dev tools are GUI based (just look at Visual Studio, for example). You might have to fiddle around with the $PATH variable (that's what it's called on Windows, right? Or was it %PATH...) to make sure your compiler is accessible via the command line.
On linux, that's never a problem though, since you can go to just about any linux computer with gcc installed and a text editor and start coding.
I mean, it's not like you _have_ to use the GUI portion of wxDevcpp, you could also just as easily go get Devcpp, which does not have the wxWidgets library bundled with it, but wxDevcpp seems less dated. All wxDevcpp does is offer a form designer if you ever want to use it, along with some wxWidgets libraries. You still get all the terminal coding goodness from wxDevcpp.
If you want to take md's approach, notepad++ is a good source code editor for windows, I'm pretty sure it has compiling options too, I'm unsure whether it's open source or not though.
Anyway, whatever option you choose, good luck!
md
Posted: Fri Jan 04, 2008 5:59 pm Post subject: RE:Help learning C and choosing a complier
As for compilers; there is a great C compiler called TCC (Tiny C Compiler) that does have a windows port. I haven't ever tried it on windows myself, but it's wicked on linux.
php111
Posted: Sun Jan 06, 2008 5:23 pm Post subject: Re: Help learning C and choosing a complier
Hey, I was just quickly reading over this thread. Is MinGW made for Windows? I keep getting a connection dropped out.
Clayton
Posted: Sun Jan 06, 2008 6:11 pm Post subject: RE:Help learning C and choosing a complier
Yes, yes it is.
php111
Posted: Sun Jan 06, 2008 7:43 pm Post subject: Re: RE:Help learning C and choosing a complier
Clayton @ Sun Jan 06, 2008 6:11 pm wrote:
Yes, yes it is.
hmm if it is for Windows then why is my connection dropping? Could it be for running p2p?
md
Posted: Sun Jan 06, 2008 7:45 pm Post subject: RE:Help learning C and choosing a complier
what does it being a windows program have with your connection dropping?
I ask as a mere mortal who sees no connection whatsoever.
php111
Posted: Sun Jan 06, 2008 7:53 pm Post subject: Re: RE:Help learning C and choosing a complier
md @ Sun Jan 06, 2008 7:45 pm wrote:
what does it being a windows program have with your connection dropping?
I ask as a mere mortal who sees no connection whatsoever.
MinGW said my connection was dropping. I don't know why and it was the first time it happened.