Thread: What is the use of this function?

  1. #1
    Registered User
    Join Date
    May 2019

    Question What is the use of this function?

    hello friends,

    i want to know what is the use of this function

    void gotoxy(int x ,int y){
     coord.X = x;
     coord.Y = y;
    also before this i see this line
    COORD coord= {0,0};

  2. #2
    Registered User
    Join Date
    May 2009
    Still need to improve your web searching skills!
    gotoxy in C | Programming Simplified
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  3. #3
    Registered User
    Join Date
    May 2019
    well that program doesnt run on codeblocks
    i understand that it is used to change cursor position but

    what is the use of
    and this
    COORD coord= {0,0};

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Then search the Web for "SetConsoleCursorPosition"
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5

  6. #6
    Old Fashioned
    Join Date
    Nov 2016
    Furthermore, your question is this:

    "i want to know what is the use of this function "

    That is a bit concerning because quite literally, the use of the function is to set the console cursor position. Some functions are cryptic or at least have less straightforward names like atoi() for example...

    But that one is literally called SetConsoleCursorPosition()... So the question you're asking can be answered by... reading the function name. You didn't ask for how to use it, or how to implement it, you just asked for the use of it. So for that, you don't even really need to search!

    On top of that, the coords object is pretty full-of-clues as well... It's obviously an object which stores coordinates and thus passing that to the function will set the console cursor position to those coordinates...

    I'm not trying to be mean or condescending, but you will need to improve either your English language understanding skills and certainly your searching skills as pointed out above if you want to be able to consistently follow C programs written by others and really become skilled at this.

    I'll give you the benefit of the doubt and assume you've never done ANY front-end or graphical programming whatsoever. A very common way for pixels and visual objects to be manipulated on screen is to split the screen into pixels and then work with them using x and y coordinates like you've just seen.
    Last edited by Asymptotic; 3 Weeks Ago at 12:45 PM.
    If I was homeless and jobless, I would take my laptop to a wifi source and write C for fun all day. It's the same thing I enjoy now!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function Prototype, Function Call, and Function definition
    By dmcarpenter in forum C Programming
    Replies: 9
    Last Post: 04-09-2013, 03:29 AM
  2. Replies: 11
    Last Post: 09-07-2012, 04:35 AM
  3. Replies: 13
    Last Post: 03-20-2012, 08:29 AM
  4. Print function: sending a function.. through a function?
    By scarlet00014 in forum C Programming
    Replies: 3
    Last Post: 11-05-2008, 05:03 PM
  5. Replies: 9
    Last Post: 01-02-2007, 04:22 PM

Tags for this Thread