C++

Narz

keeping it real
Joined
Jun 1, 2002
Messages
31,514
Location
Haverhill, UK
In a couple of weeks I'm going to take a course in C and C++. I want to know a bit before I start though. My objective in taking this course is to get back into programing and eventually create my own game (my dream since age 7 then I've since let slip away). Any pointers? Also, does anyone here program in C? If so, do you know any good sample programs (created by you or others)? I find the best way I learn is not by reading tons of explanations of code but by seeing the code in action (preferably with notes) in someone else's game/program, etc.

If you don't want to post files here, e-mail them to me at anthonarz@aol.com or anthonarz@rcn.com. Much obliged!

- Narz :king:
 
Hmm, I've done quite a bit of C/C++ programming, but it's all classified Top Secret! :eek: (Really! I kid you not! Even copying the code to this computer would be grounds for a criminal investigation.) Anyway, I haven't got any samples for you. Besides, the stuff I've done has been rather esoteric, and probably not too applicable to games. I'll be glad to try to answer specific questions, though. :)
 
Yeah, I could help you, too. But I think the code I still have lying around is too specific and not for beginners.

There are tons of really good books out there, trying to teach the way you prefer to learn. Just look around a bit.
:D
 
I found it great to come up with a simple program idea, read the book for what I need, try it and have someone that knows on-line to chat with and helpwith the problem. Corn helped me a lot to make my first program (copies music download from Kazaa from the download directory to my wife's music directory - she has to manual pick the songs). I didn't know the all of the commands and asked Corn for help on that....but I did gain a lot of understanding of how it works. Unfortunately I have just begun my journey with VB so I will not be much help to you other than this advice....good luck! :D
 
Originally posted by Narz
Any pointers?

Ha ha ha.

Oh yes there are pointers all right. :lol: :lol: :lol:

Really i can't believe the rest of you let such an opportunity slip. As a java programmer i couldn't.
 
Yeah, normally it is the Java program(mer)s that run slower! ;)
 
Originally posted by Heffalump
Originally posted by Narz


Ha ha ha.

Oh yes there are pointers all right.

Really i can't believe the rest of you let such an opportunity slip. As a java programmer i couldn't.

Argh! Too many images (I didn't have any!) And I missed TF in chat too. :(

Anyway, I'll make it short:

There's stuff such as while loops, if/else statements, etc...

arrays: a group of varibles of the same type.
int numbers[15];
In C++, 0 is usually the start of arrays. (These can be tricky)

constant varibles - varibles that can't be changed (can be global).
global - Every function knows about this varible (bad programming practice)

static varibles - semi-global varibles. These can be in a function, and their value won't change when you leave that function.

Local varible - A varible that only that function knows.

Pass By Value - A varible that's passed to another function. Any changes in the 2nd function are forgetten when you leave that function.

Pass By Reference - Like PBV, but any changes in the 2nd function affect the varible in the 1st.

Some do's and don't for gaming.

1. Never, NEVER just jump into programming a game. Games can get quite complex, and you'll most likely end up with speghetti code. I made that mistake when I was a kid and a teen. Think of what you want (analyze it). You might find that you need several engines for the game. Take 1 at a time, and split it into functions. Coding and varibles should be the last thing you do.

2. "70% of programming is psuedo-code". But, only 5-10% of Software Development is programming. Why? There's 7 major steps. To make it short, it's seeing what you want and if you can do it. Then see how each function will behave, design it, code it, then test it.
 
Back
Top Bottom