S
Sava Mikalaèki
Hi to all of you god programmers in the world!
One question:
When I want to load a value in some variable (ex. int x) I use cin << x. Ok,
but if I want to use cin.get() what would it be? I'we tryed something like
this:
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "Enter a nuber: ";
x=cin.get();
return 0;
}
But, when I compile it and run it when I enter a value (for example, 3) and
write it
on the screen i get number 6. (or 5 it prints out 8). It's clearly that I'm
doing
something wrong but what?
Regards,
SaVa
One question:
When I want to load a value in some variable (ex. int x) I use cin << x. Ok,
but if I want to use cin.get() what would it be? I'we tryed something like
this:
#include <iostream>
using namespace std;
int main()
{
int x;
cout << "Enter a nuber: ";
x=cin.get();
return 0;
}
But, when I compile it and run it when I enter a value (for example, 3) and
write it
on the screen i get number 6. (or 5 it prints out 8). It's clearly that I'm
doing
something wrong but what?
Regards,
SaVa