I was looking within the past few weeks for a true simple example of the cursor position function use, these forums seems to be my last stop before giving up.
I've read the msdn article,much more from other sites, about this function but I cant get it to work.
#include <stdio.h>
#include <conio.h>
main()
{
int a=97,b,c;
for(b=0;b<=2;b++) //3 lines
{
c=a+8; //# of letters each line
for(;a<=c;a++) //printing them up
putchar(a);
putchar(10);
}
//BOOL WINAPI SetConsoleCursorPosition( __in HANDLE hConsoleOutput, __in COORD dwCursorPosition);
//printf("\bo"); <-switching d with o
//BOOL WINAPI SetConsoleCursorPosition( __in HANDLE hConsoleOutput, __in COORD dwCursorPosition);
//printf("\bd"); <-switching o with d
while(a);//a loop just to keep the window opened
}
I would like to switch the letter d with the letter o. what should I change\edit\delete\rewrite in the program?
sorry to interupt but i noticed that too, it isnt that hard to replace, so personally i had no problem with it.
but for others ur defently right, it is an essentially important point to clear up buddy
A small question to Duoas
Line 7 is coord.Y = row;, shouldn't it be coord.Y = line; like the function parameter?
Oops! Fixed. :-|
[edit] I just typed that in off the top of my (mostly awake) head, and I've been doing a lot of programming in Pascal lately, so my fingers don't always do what my head is thinking... Heh :-S