سلام من از تابع gotoxy که گذاشتید استفاده کردم ولی هر بار با اینکه مقدار ورودی هاشو تغییر میدم ولی مکان نما به همون مکان اولش بر میگرده. لطفا راهنمایی کنید.
#include "stdafx.h"
#include <iostream>
#include <conio.h>
#include <windows.h>
using std::cout;
using std::cin;
void gotoxy(int x,int y)
{
HANDLE hConsole = GetStdHandle ( STD_OUTPUT_HANDLE );
if (INVALID_HANDLE_VALUE != hConsole)
{
COORD pos = {10, 10};
SetConsoleCursorPosition( hConsole, pos );
}
}
void main()
{
int i=0,j=0;
while(getch()!='0')
{
gotoxy(i,j);
cout<<"#";
i++;
j++;
}
}