Hey guys,
im pretty new to c++ programming and am using visual c++ 2010.
I recently created a little program and the best way to describe it
is by saying its similar to the terminal hacks from the video game fallout.
its a simple program that asks you to select a password from a list, the correct
one shows some text while the incorrest answer displays an error and closes the
program. Im looking for some advice that could help make it simpler, more neat
and to explain any errors i've made to me. Any improvements you think would be good i will happily try them as im new to this and want to soak up as much info as poosible... i will post the code below if anybody wants to try it. Thanks
Thanks phil will try it with changes now, sorry i did'nt know about the code tags.
The code should now be formated with the tags.
By the way is /n an easier way to skip a line in the program because uptill now i've been using cout << endl;
cout << someInteger << endl;
// looks alot nicer than
cout << someInteger << "\n";
// and
cout << "Hello, how are you?\n";
// is a little less work than
cout << "Hello, how are you?" << endl;
Basically, \n is just a character. It has an ascii value and all that jazz. std::endl is a stream manipulator, which is a function. As you can already probably imagine, that's going to be more costly.
Basically, \n is just a character. It has an ascii value and all that jazz. std::endl is a stream manipulator, which is a function. As you can already probably imagine, that's going to be more costly.