Pause c program with input redirection -


i wrote following simple code in c , used input redirection batch file. how can pause program inside while loop?

#include <stdio.h>  int main(void)  {   char buffer[2048];      while ( !feof(stdin) ) {     gets( buffer );     printf( "%s", buffer );     //i want pause program here, until press enter     }   return 0; } 

the batch file is: main.exe < input.txt >output.txt


thanks in advance!

#include <stdio.h> #include <conio.h>  int main(void){     char buffer[2048];      while ( !feof(stdin) ) {         gets( buffer );         printf("%s", buffer );         while(!_kbhit());         _putch('\n');         while(_kbhit())             _getch();     }     return 0; } 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -