Hey, I'm new here and fairly new to programming :/ I want to invest in one or two C++ books, can anyone recommend some? I have little to no experience in programming :( unfortunately. However I have created a very small cmd game where you need to guess the number between 0 and 1000 so that's about it
Any recommendations will be appreciated :)
Thanks in advance
For people with "little to no experience in programming", the recommended book is usually Stroustrup's "Programming: Principles and Practice using C++"
Wow Thanks for the help :P didn't expect to get replies this quick :)
can i see the game?xD
errr... maybe
wow this is gonna be embarrassing :P
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int iGuess;
int iUserguess;
int iGuesses = 0;
while(true)
{
system("CLS");
cin.clear();
iGuesses = 0;
srand(static_cast<unsigned int>(time(0)));
iGuess = rand()%1000+1;
cout << "Welcome to the Guessing Game!\nWhat number am I thinking of? Between 0 and 1000 :) Good luck!"
<< endl;
do
{
cout << "Enter your guess: ";
cin >> iUserguess;
if(iUserguess > iGuess)
{
cout << "To High!" << endl << endl;
}
if(iUserguess < iGuess)
{
cout << "To Low!" << endl << endl;
}
iGuesses ++;
}while(iUserguess > iGuesses || iUserguess < iGuesses);
cout << "You guessed the right number Well done!" <<endl << endl;
cout << "It took you " << iGuesses << " Guesses " << endl << endl;
system("PAUSE");
}
return 0;
}
I have had a little problem with this... I'm sure to a lot of you this will be easy, but I can't figure out what's wrong with it... Please can you have a look?
And PLEASE remember this is my first program :/
I like Dawons's C++ Through Game Programming. The game programming is really simple so don't expect to come up with Minecraft from that book, but it's one of the few (if only) out of many I've tried that I've stuck with so far on my C++ n00b quest =) $20 or so around the web.
Oh yeah,,, I'm not expecting to make something as on a huge scale. I'm proud of that shitty guessing game :P I just think this is something I want to learn and perhaps follow in the future :)
Anyways, in case you get some errors, you should use code tags, not output tags, when you post code.
First you select the code, then you press the '<>' button.
Thanks for having used, at least, the output tags.
Also take a look at these, they may become useful for you:
* 1 - This is probeboly the best of them from when i was lerning the basics.
Beginning Programming with C++ for Dummies by Stephen R. Davis (Great Book Comes with "Live CD" with courses and sources on the CD\DVD with compiler also)
* 2 - Effective C++ Third Edition 55 Specific Ways yo Improve Your Programs and Design by Scott Myers (Absolutely worth reading!)
*3 - Effective STL 50 Specific Ways to Improve Your Use of The Standard Template Library (It sorta goes together with the one above).
Hope it helps and am not impling your stupid am impling am a bit stupid :p hehe
Happy Holidays and a Happy New Year!
@EssGeEich oh sorry, i haven't seen your links... i wonder why is that
maybe because i hate links, or i have a traumatic experience of them damn links...well u wouldn't know that cause i never told anyone about it
I was just being sarcastic, lol.
Anyways, to not-getting-this-post-reported, I'll list my last books i've read:
Addison Wesley - Efficient C++ Programming Techniques
David Vandevoorde/Nicolai M Josuttis - C++ Templates The Complete Guide
Sharam Hekmat - C++ Essentials
Scott Meyers - Effective C++
Scott Meyers - More Effective C++
Andrei Alexandrescu - Modern C++ Design
Herb Sutter - More Exceptional C++
Bruce Eckel - Thinking in C++