View Poll Results: what is your favorite language?

Voters
16. You may not vote on this poll
  • c++ or c

    12 75.00%
  • basic

    1 6.25%
  • pascal

    2 12.50%
  • cobol

    1 6.25%

Thread: anyone knows what's wrong?!?!?

  1. #1
    Registered User
    Join Date
    Jun 2002
    Posts
    4

    Post anyone knows what's wrong?!?!?

    i have this source code to set the cursor position but i don t know what s wrong with it
    could you plz help or send me another piece of code??
    by the way i have this function that comes in the c++ library setCursorPos(x , y)
    but it doesn't work either
    i need some instructions about it, too.
    ------------------------
    void location(int x, int y)
    {
    HANDLE OutputH;
    COORD position = {x, y};
    OutputH = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleCursorPosition(OutputH, position); }
    __________________________
    msvc++ 6.0
    __________________________
    "I wasted time till time wasted me " Savatage(believe)

  2. #2
    Registered User Mario's Avatar
    Join Date
    May 2002
    Posts
    317
    On what were you thinking when you made that poll? Where you thinking at all?
    Regards,
    Mario Figueiredo
    Using Borland C++ Builder 5

    Read the Tao of Programming
    This advise was brought to you by the Comitee for a Service Packless World

  3. #3
    ResurgentBarbecue UnclePunker's Avatar
    Join Date
    May 2002
    Posts
    128
    Strange Person?
    Compiler == Visual C++ 6.0
    "Come Out Fighting."

  4. #4
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Hmm...the answer is Cobol....

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Seriously....your code is ok...it must be your implementation...

    Code:
    #include <windows.h>
    #include <iostream>
    using namespace std;
    
    void location(int x, int y)
    {
    HANDLE OutputH; 
    COORD position = {x, y}; 
    OutputH = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleCursorPosition(OutputH, position);
    }
    
    int main(void)
    {
        location(10,5);
        cout << "Hello world";
    return 0;
    }
    My guess is that you might be confusing the position as being relevant to pixels, when in fact the function relates to char position......if you put location(100,500); for instance, the function will fail...

  6. #6
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    what kind of person posts a 'favorite language' poll in a c++ board?

  7. #7
    lol

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM