0
I am in need of the current "cursor" coordinates of the screen, for the user to remain in the current line.
EXAMPLE
void main{
char nome[50];
char sobrenome[50];
int linhaAtual;
linhaAtual = ????;
gotoxy(1, linhaAtual);
printf("Insira seu nome:");
scanf("%[^\n]s", nome);
gotoxy(1, linhaAtual);
printf("Insira seu sobrenome:");
scanf("%[^\n]s", nome);
system("pause");
}
OBS
In the example I am not taking into consideration the need to clean up every line. I will develop.
RESEARCH
property wherex()
, wherey()
- It doesn’t work, I don’t know why.
property __LINE__
- apparently the count is different.
I’m glad that
__LINE__
didn’t work. Have you ever wondered why there is only the row and not the column in it? Let’s go to what is related to what you want: because thewhere?()
does not work? If you who made the application do not know the reason, we know less yet. You did not put the#include
you are using. This is important. I hope you are not usingconio.h
, this is not part of the standard and is obsolete.– Maniero
@Guilherme-lautert for you, pointer = cursor? Edit the question and adjust that detail, it makes quite a difference.
– karlphillip
@Bigown, I was curious about "I’m glad
__LINE__
did not work out." and searched for this: http://www.lemoda.net/c/line-file-func/ Very interesting, in my previous search__LINE__
, was pointed to as position of coordinate y, only no "file" was mentioned.#include conio.h
, in fact is exactly what I am using, I am aware of the existence of theconio2.h
, yet I thought there might be some parental property in C itself.– Guilherme Lautert
@karlphillip I know that pointer != cursor, but technically I don’t either
|
line as a cursor. Could not express me correctly at the time.– Guilherme Lautert
@Guilhermelautert I understand you, but when we want help from the community we have to use the technical terms that are part of the terminology of the area, otherwise we run the risk of not being understood. If cursor is an appropriate name or not to define this functionality I do not know, but the books, manuals and documentations refer to it by this name.
– karlphillip