Hi, could someone please tell me what function pauses a console program to stop it from dissapearing at the end.
Is it readln() or something like that?
Thanks
Hi, could someone please tell me what function pauses a console program to stop it from dissapearing at the end.
Is it readln() or something like that?
Thanks
did you hear about the incredible FAQ?
My Tutorials :
- Bad programming practices in : C
- C\C++ Tips
(constrcutive criticism is very welcome)
- Brain Cell
here go!
Wait to have help u!Code:int main(){ char ch; printf("Press one key for continue..."); while((ch=fgetc(stdio))!='\n'); printf("You hit the key %c!",ch); return 0; }
/**************Um abraço*************/
'ch' should be an 'int' because thats what 'fgetc()' return.Code:char ch;
fgetc()'s prototype :Code:int fgetc(FILE *stream);did you even test your code before posting it?Code:while((ch=fgetc(stdio))!='\n');it should be 'stdin' not 'stdio'.VC++6 error : error C2065: 'stdio' : undeclared identifier
My Tutorials :
- Bad programming practices in : C
- C\C++ Tips
(constrcutive criticism is very welcome)
- Brain Cell