answersLogoWhite

0

to locate coordinates ..

User Avatar

Wiki User

13y ago

What else can I help you with?

Continue Learning about Engineering

Tell more about gotoxy statemant and more of its use in c and c plus plus?

gotoXY function is defined in conio.h, it places the cursor to the given position. If you have any question about it, use the built-in help.


How do you write a program using the gotoxy statement and print function to display letters of the alphabet on the computer screen?

There is no gotoxy statement in C.


What is the header file for gotoxy in c?

There is no such function as gotoxy(). It was originally a standard function in conio.h, used to set the console cursor position, but it was deprecated because it was non-portable. While it may still exist in older C compilers, its usage would be frowned upon today and no known C or C++ compiler should support such a function these days. You are free to "roll your own" version of the function, of course. The following version works on Windows only. But given how little it actually adds to what already exists, and its non-portable nature it hardly seems worthwhile. #include <stdio.h> #include <conio.h> #include <windows.h> // Standard version: void gotoxy( COORD c ) { SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), c ); } // Overloaded version emulating original gotoxy function: void gotoxy( int x, int y ) {COORD c;c.X = x;c.Y = y; gotoxy( c ); // call standard version }


What is syntax in gotoxy?

AnswerGotoXY is a function or procedure that positions the cursor at (X,Y), X in horizontal, Y in vertical direction relative to the origin of the current window. The origin is located at (1,1), the upper-left corner of the window. AnswerDescription This shows how to use the gotoxy function in C to move the text cursor to a different location on the screen Code#include#includeint main(void){int i;printf("This is the first line.\n");gotoxy(10,4);printf("This is the second line.\n");gotoxy(20,8);printf("And this is line 3.\n");return 0;}


Can we use gotoxy function in C plus plus?

Ideally you would not manipulate std::cout using such a low-level function. Console output is intentionally generic so that output can be easily redirected to any output device that accepts a character stream. As such, this code will not work correctly if the user were to redirect output to a disk file or a printer, or use the output as input to another program. If you wish to format screen output in a non-generic manner, do not use the console, use a screen-specific context device instead. #include<iostream> #include<string> #ifdef WIN32 #include<windows.h> #endif WIN32 void gotoxy(int x, int y) { #ifdef WIN32 static HANDLE h = NULL; if(!h) h = GetStdHandle (STD_OUTPUT_HANDLE); COORD c = { x, y }; SetConsoleCursorPosition (h,c); #elif linux printf("%c[%d;%df",0x1B,y,x); #else static_assert (false, "unsupported platform in gotoxy()"); #endif WIN32 } void draw_box(unsigned x, unsigned y, unsigned width, unsigned height) { gotoxy (x, y); std::cout << std::string (width, '*'); for (unsigned z=2; z<height; ++z) { gotoxy (x, ++y); std::cout << "*"; gotoxy (x+width-1, y); std::cout << "*"; } gotoxy (x,++y); std::cout << std::string (width, '*'); } int main() { draw_box(10,10,5,4); // draw 5x4 box at {10,10} gotoxy (0,25); }

Related Questions

Which header file is used for gotoxy function in turbo c plus plus?

It's in conio.h, but don't use gotoxy. Use SetCursorPosition() instead.


Tell more about gotoxy statemant and more of its use in c and c plus plus?

gotoXY function is defined in conio.h, it places the cursor to the given position. If you have any question about it, use the built-in help.


What is gotoxy in turbo c?

A function, defined in conio.h. Use the help.


How do you write a program using the gotoxy statement and print function to display letters of the alphabet on the computer screen?

There is no gotoxy statement in C.


What is the header file for gotoxy in c?

There is no such function as gotoxy(). It was originally a standard function in conio.h, used to set the console cursor position, but it was deprecated because it was non-portable. While it may still exist in older C compilers, its usage would be frowned upon today and no known C or C++ compiler should support such a function these days. You are free to "roll your own" version of the function, of course. The following version works on Windows only. But given how little it actually adds to what already exists, and its non-portable nature it hardly seems worthwhile. #include <stdio.h> #include <conio.h> #include <windows.h> // Standard version: void gotoxy( COORD c ) { SetConsoleCursorPosition( GetStdHandle( STD_OUTPUT_HANDLE ), c ); } // Overloaded version emulating original gotoxy function: void gotoxy( int x, int y ) {COORD c;c.X = x;c.Y = y; gotoxy( c ); // call standard version }


What is syntax in gotoxy?

AnswerGotoXY is a function or procedure that positions the cursor at (X,Y), X in horizontal, Y in vertical direction relative to the origin of the current window. The origin is located at (1,1), the upper-left corner of the window. AnswerDescription This shows how to use the gotoxy function in C to move the text cursor to a different location on the screen Code#include#includeint main(void){int i;printf("This is the first line.\n");gotoxy(10,4);printf("This is the second line.\n");gotoxy(20,8);printf("And this is line 3.\n");return 0;}


Can we use gotoxy function in C plus plus?

Ideally you would not manipulate std::cout using such a low-level function. Console output is intentionally generic so that output can be easily redirected to any output device that accepts a character stream. As such, this code will not work correctly if the user were to redirect output to a disk file or a printer, or use the output as input to another program. If you wish to format screen output in a non-generic manner, do not use the console, use a screen-specific context device instead. #include<iostream> #include<string> #ifdef WIN32 #include<windows.h> #endif WIN32 void gotoxy(int x, int y) { #ifdef WIN32 static HANDLE h = NULL; if(!h) h = GetStdHandle (STD_OUTPUT_HANDLE); COORD c = { x, y }; SetConsoleCursorPosition (h,c); #elif linux printf("%c[%d;%df",0x1B,y,x); #else static_assert (false, "unsupported platform in gotoxy()"); #endif WIN32 } void draw_box(unsigned x, unsigned y, unsigned width, unsigned height) { gotoxy (x, y); std::cout << std::string (width, '*'); for (unsigned z=2; z<height; ++z) { gotoxy (x, ++y); std::cout << "*"; gotoxy (x+width-1, y); std::cout << "*"; } gotoxy (x,++y); std::cout << std::string (width, '*'); } int main() { draw_box(10,10,5,4); // draw 5x4 box at {10,10} gotoxy (0,25); }


What is the meaning of gotoxy?

gotoxy is a function in some programming languages, such as Turbo C, that is used to move the cursor position to a specific coordinate on the screen. This function is commonly used in text-based console applications to control where text or graphics are displayed.


How do you create folder with c plus plus?

Use function mkdir.


How do you enter a sentence as input in c plus plus?

Use the C++ getline() function from the standard library.


How do you set the cursor in turbo c?

gotoXY from conio.h


What is the operator of power in c plus plus?

There is no "power" operator in C or C++. You need to the use the math library function pow().