Thread: Help in Gotoxy(), error :(

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    22

    Help in Gotoxy(), error :(

    I'm learning Gotoxy and how to use it, I read in the faqs about it but I got a problem, I use DevC++ and my project is in C.

    Code:
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
    there is an error in this statement

    C:\Dev-Cpp\main.c `STD_OUTPUT_H' undeclared (first use this function)



    Code:
    #include<stdio.h>
    #include<windows.h>
    
    void gotoxy(int x, int y)
    {
    COORD coord;
    coord.X = x;
    coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
     
    int main()
    {
    printf("Hello!");
    gotoxy(10,10);
    printf("Hello!");
    getch;
    return 0;
    }

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Are you sure there's supposed to be a space in there?

    Which makes more sense? "H ANDLE" or "HANDLE"?
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    22
    Oh Right ) I forgot, i thought there is something wrong in the statement so that is the problem

    now there is a new problem
    my main can't be read ((

    11 C:\Dev-Cpp\main.cpp `main' undeclared (first use this function)

    Code:
    #include<stdio.h>
    #include<windows.h>
     
    void gotoxy(int x, int y)
    {
    COORD coord;
    coord.X = x;
    coord.Y = y;
    SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
      
    main()
    {
    printf("Hello!");
    gotoxy(10,10);
    printf("Hello!");
    getchar();
    return 0;
    }

  4. #4
    Registered User
    Join Date
    Oct 2011
    Posts
    22
    NVM I I saw the problem, I'm think im just high today

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Error in using gotoxy() !!
    By M.E.Z in forum C++ Programming
    Replies: 2
    Last Post: 12-09-2009, 05:03 AM
  2. gotoxy
    By Ivan! in forum C++ Programming
    Replies: 10
    Last Post: 03-28-2003, 10:28 AM
  3. gotoxy()
    By Commander in forum C Programming
    Replies: 3
    Last Post: 05-28-2002, 04:33 PM
  4. Using gotoxy
    By Esparno in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2002, 08:20 AM
  5. Gotoxy
    By drdroid in forum C++ Programming
    Replies: 9
    Last Post: 02-10-2002, 01:22 PM