|
|
|
|
_getch()
, #include <conio.h>
|
|
1>------ Build started: Project: CMD, Configuration: Debug Win32 ------ 1> CMD.cpp 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(24): error C3861: '_getch': identifier not found 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(25): error C2059: syntax error : ';' 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(26): error C2065: 'vari' : undeclared identifier 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(26): fatal error C1903: unable to recover from previous error(s); stopping compilation ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
#include <conio.h>
char vari = _getch();
you may want to add a cout, so the user knows to press enter to re-run the code or any other key to exit.
1>------ Build started: Project: CMD, Configuration: Debug Win32 ------ 1> CMD.cpp 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(26): error C2059: syntax error : ';' 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(27): error C2065: 'vari' : undeclared identifier 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(27): fatal error C1903: unable to recover from previous error(s); stopping compilation ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
1>------ Build started: Project: CMD, Configuration: Debug Win32 ------ 1> CMD.cpp 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(27): error C2065: 'vari' : undeclared identifier 1>c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(28): fatal error C1075: end of file found before the left brace '{' at 'c:\users\daniel\documents\visual studio 2010\projects\cmd\cmd\cmd.cpp(6)' was matched ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
|
|
return 0;
causes the program to return an exit code from main, which ends the program.
|
|
while( _getch() == 13 )