Hi again everyone. I am trying to learn to program with C right now and I am following a guide to learn C in 24 hours. I understand the stuff I have read so far but there are 2 examples (they are SUPER simple, like 10 lines) that I cant get to compile for some reason. In his guide he uses MS C++ 1.5 which is really old. I am using 6.0 so that may be the problem. But anyway I was wondering if anyone might be able to help me out. I dont know if I have something set up worng in 6.0 or what... Heres the guide im using: http://aelinik.free.fr/c/ Chapter 2 has the 2 examples in it. I have put them in a text file, made sure they have the .c extension and tried just about everything that I can think of. When I try to compile it in 6.0 it gives me a stupid error. Heres a screenshot of what it does when I try to compile it: It says really early on in chapter 2 that if "I have the proper development enviroments setup" I can compile it and run it. But it dosent tell me how to set up a enviroment so that could also be my problem. If anyone here can help me out I would be eternally greatful. Thanks for reading! ray:
Hmm, are those numbers part of the code? Try removing the numbers 1-8 so that the code reads this: Code: /* 02L01.c: This is my first C program */ #include <stdio.h> main() { printf ("Howdy, neighbor! This is my first C program.\n"); return 0; } instead of this: Code: 1: /* 02L01.c: This is my first C program */ 2: #include <stdio.h> 3: 4: main() 5: { 6: printf ("Howdy, neighbor! This is my first C program.\n"); 7: return 0; 8: }
OMG THANK YOU SO MUCH!!!! I have been really scared of tackeling C in the last year, so I bought some books and found that guide and thought I was finally ready and 30 min in I get hung up on something stupid like that. Thank you so much for the help. It works great now. If I get stuck again I might have to ask for your help again if thats cool with you. I am wanting to program for the GBA but I know I need to know C first so im taking the first step. My dream project is to re-make the NES version of Mega Man 2 on the GBA with diffrent level designs. ( I always thought I could do better then the default Anyway thanks so much for the help. Let me know if you ever need anything!
No problem man! If I may ask, what additional tools are you using for GBA programming? I remember myself trying out the unofficial GBA SDK with VC++ 6 nearly 4 years back! h:
Well I have this thing called HAM. I guess its a sort of XDK. Anyway I have a awsome guide to GBA programming. Its short and to the point but I think it will actually work quite well. I can send you the guide and tools if you want them. I got 2 chapters or so into the GBA guide and he tells you that you need to know how to use C or C++. But he says C++ is overkill so im just going to start with C. Like I said if you want the guide and software I download both legally and they are both free.
If the guide oyu are using is "Programming hte Gameboy Advance", I'd watch out for some sections. Some of the example code/algorithms are wrong and won't compile. If you have problems with some of the early chapters, give me a shout and I'll help if I can
yeah I think thats the one. Thanks for the tip. Do you know if anyone has a site with the correct codes or something like that? Anyway I will definitly let you know when I slam into a wall (should be quite ofton -_^)
The main issue witht he book is that alot of the stuff is simplified or not explained properly. For the best (and somewhat more complex) explanations, go here. TONC is alot more confusing (to me, at least), but it actually explains things as they are, rather than skimming bits like in the book. Don't get me wrong, teh book was very helpful to start with...but as it starts getting more complex, it feels more like you are copying out of the book rather than understanding.