Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why gotoxy does not work in this compiler

+2 votes
asked Dec 26, 2020 by anisha (150 points)
#include <stdio.h>
int main()
{
    gotoxy(30,5);
    printf("biodata");
    return 0;
    
    
}

2 Answers

+1 vote
answered Dec 26, 2020 by xDELLx (10,500 points)

Few Questions immediately pop up.If you get answer to these,you can yourself fix the problem:

  • Which header file contains the declaration of gotoxy() ?
  • Did you forget to implement the function gotoxy?
  • By chance ,if you have the documentation of this function,can you check if it needs specific libs ,headers  or other files which have to be added during compilation.
0 votes
answered Dec 26, 2020 by Test Serwer (180 points)

#include<windows.h>

void gotoxy(int x, int y)
{
     COORD c;
     c.= x-1;
     c.= y-1;
     SetConsoleCursorPosition (GetStdHandle (STD_OUTPUT_HANDLE), c);
}

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...