Standard C++ does not allow this. Only a couple compilers have extensions that will, but learning to rely on non-standard functionality hurts you when you need to use different compilers.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
where did he say he doesnt want to use the non standard libraries?
He didn't.
We prefer to suggest standard functionality rather than relying on tricks and non-standard techniques because you cannot transfer the non-standard skills to other compilers. Especially things like getch().
Also, if he's using g++, Watcom, or any of a couple hundred other compilers, using getch() isn't even an option. So we keep our help standard unless specifically asked.
he even used it in his code just in the wrong place :O
though i could be wrong >.<
Yes, you are wrong. His code is standard.
WaltP
Posting Sage w/ dash of thyme
11,404 posts since May 2006
Reputation Points: 3,421
Solved Threads: 1,055
Skill Endorsements: 37
so anyway no option to get stream from the keyboard?
No portable option. There are non-portable options, but we kind of have to know what OS and compiler are being targeted before any viable options can be suggested.
deceptikon
Challenge Accepted
3,505 posts since Jan 2012
Reputation Points: 824
Solved Threads: 481
Skill Endorsements: 58