Output problem

i have this:

#include <iostream>
#include <windows.h>
#include <conio.h>

using namespace std;



void gotoxy(short x, short y) {
COORD pos = {x, y};
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);}


int main () {

int a,b,c,d,e=1;

for (a=0;a<=59;a++){
for (b=0;b<=59;b++){
for (c=0;c<=59;c++){
for (d=0;d<=59;d++){

gotoxy(38,5);
cout<<a<<":"<<b<<":"<<c<<":"<<d;
if (kbhit()){

getchar();

cout<<"lap"<<e<<" "<<a<<":"<<b<<":"<<c<<":"<<d;
cout<<"\n";
e++;
}









}}}}









system("pause");
return 0;
}


i want my next output to display below the first display and so on. can someone help me?
You have a gotoxy() function to move to a specific place on the screen. Simply calculate where you want the cursor to appear and call gotoxy().

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Last edited on
Topic archived. No new replies allowed.