I wanna make a program which can print one line and then it will wait for the signal(space bar's input), after that, it will print the second line.
eg
1.
aaaaaaa
(wait)
2.
aaaaaaa
(space_bar pressed)
3.
aaaaaaa
bbbbbbb
(wait)
4.
...
thx!!~
Printable View
I wanna make a program which can print one line and then it will wait for the signal(space bar's input), after that, it will print the second line.
eg
1.
aaaaaaa
(wait)
2.
aaaaaaa
(space_bar pressed)
3.
aaaaaaa
bbbbbbb
(wait)
4.
...
thx!!~
This prints a line every time you press the space bar. Press enter to quitCode:#include <iostream>
#include <conio.h>
using std::cout;
using std::endl;
int main(void){
char c;
while(c = getch()){
if(c == ' ')cout << "aaaaaaa" << endl;
else if(c == '\r')break;
}
return 0;
}