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%

anyone knows what's wrong?!?!?

This is a discussion on anyone knows what's wrong?!?!? within the C++ Programming forums, part of the General Programming Boards category; i have this source code to set the cursor position but i don t know what s wrong with it ...

  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,786
    Hmm...the answer is Cobol....

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,786
    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,493
    what kind of person posts a 'favorite language' poll in a c++ board?

  7. #7
    Nerd Xmevs's Avatar
    Join Date
    Apr 2002
    Posts
    146
    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, 09: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, 11:01 AM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21