ok....

Started by
13 comments, last by rainfever 15 years, 11 months ago
Quote:Original post by Jouei
char Text[250];
cin >>Text;

This happens when someone learns C before C++ I suppose :) Use real strings to prevent buffer overflows!
std::string text;cin >> text;
Advertisement
you can also try making a basic mod using quake 3, it will help you see how larger games are structured, and its super easy to make small changes that can make the game fun as well. Check out http://code3arena.planetquake.gamespy.com/ for some good (but a little dated) tutorials on that.
Quote:Basic things to the point of the old 'How to write 'Hello World!' and stuff like that in c++...


You may want to take a look at this link, first one that came up when typing in "C++ tutorial" at google ^^:
C++ Language Tutorial

Good luck.
i completly agree with the part about useing strings but rather then through a bunch of new stuff that probaly differes frmo the book he was reading or any info he has looked up i though i would just leave it as char for the moment and explain strings later as they are class based and may have just confused him at the point in time.

However id like to thank all who pointed out the stl string.

id like to also point out that you can quialify the std::string by using its namespace but it is not totaly recomended out side of a code block.

this will qualfiy all things in the standard namespace.

useing namespace std;

this will qualify just the string
useing std::string;

by qualifying it you no longer need to write tthe variable as std::string instead just useing string after qualifying it but as i sead it is not nessicarly a good idea out side of the code block useing it.

Regards Jouei.
Thx everyone for the info. Im now rereading some of the books I have. I main goal is to get to the point of making bigger and bigger text based games and later moving on to OpenGL or pass it and go right into DirectX. I would like to make my own game engine and try making games off of it. Even if it wont match some of the ones out there it would be a cool project to pass the time on ^^.

This topic is closed to new replies.

Advertisement