Hi the first question is, how can I set a min and max for the rand function. At the moment i'm seeding from ctime then using
int theNumber = rand() % max + 1
It picks a number between 0 and 100...
Type: Posts; User: Chipmunkey
Hi the first question is, how can I set a min and max for the rand function. At the moment i'm seeding from ctime then using
int theNumber = rand() % max + 1
It picks a number between 0 and 100...
So, the cin places the input into the buffer, and when I use cin.get it reads from buffer and thinks somethings been pressed? Or am I way off lol.
Thanks, it worked. But i'm still pretty confused. Whats the definition of buffer? What do you mean read in new line. Thanks again. :)
Hi, I've made a guess my number program and it ends straight after the while loop is met. And passes my cout thing after.
#include <iostream>
#include <ctime>
#include <cstdlib>
using...
Sorry to go off topic, but I'm not quite sure as to the purpose of classes. All I see is a couple of variables being declared in a separate block of code. Could someone explain it to me please?
...
So which of those do you think out of those would be better?
Or are they all good choices?
Thanks for all the replies, anyways. Do the ones you suggest apply to someone going from a little past not knowing cout - to wherever it could take me. If you could suggest one of the books which...
Sorry for the double post but I see things like this:-
http://newdata.box.sk/bx/c/
Is it the same book and is it legal?
Thanks,
Ben
I think I will buy "teach yourself C++ in 21 days". What are your opinions? I've heard it jumps straight into OOC without easing you in. Is this true? Lastly whats the difference between that one...