answersLogoWhite

0

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

}

User Avatar

Wiki User

12y ago

What else can I help you with?

Continue Learning about Engineering

How do you set cursor in turbo c as like word pad?

In Turbo C, you can set the cursor position using the gotoxy() function. This function takes two parameters: the x (column) and y (row) coordinates, allowing you to position the cursor anywhere on the screen similar to WordPad. For example, gotoxy(10, 5); will move the cursor to the 10th column of the 5th row. To use this function, ensure you include the conio.h header file in your program.


How do you create a header file and implementation of code in another c file and both should be retrieved by another .c file?

tanga


What is conio. h?

conio.h is a header file used in C and C++ programming, particularly in DOS-based systems. It provides functions for console input and output, such as gotoxy() for cursor positioning and clrscr() for clearing the screen. Although it was widely used in older compilers like Turbo C++, it is not part of the standard C library and is largely considered obsolete in modern programming environments.


How do you include a system header file called sysheader.h in a c source file?

There is no system header called share.h, but if there were, it would be: #include &lt;share.h&gt;


How can you create a headerfile in a c?

Create the header file as a .h file in the same way you create a source file, .c and place it in the same directory as the .c files. To incorporate it, use the... #include "my_header_file.h" ... directive. Note that there are double quotes instead of greater/less signs. This tells the compiler to look first in the source directory.

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.


How can you create a c program without using header file?

C programs do not require header files. If you want a C program without header files, you can simply not create them. However, you may or may not be able to include your non-header file source files.


How do you set cursor in turbo c as like word pad?

In Turbo C, you can set the cursor position using the gotoxy() function. This function takes two parameters: the x (column) and y (row) coordinates, allowing you to position the cursor anywhere on the screen similar to WordPad. For example, gotoxy(10, 5); will move the cursor to the 10th column of the 5th row. To use this function, ensure you include the conio.h header file in your program.


How many types in header file in mathh header file in c language?

Look for typedef in it, but I don't think you will find any.


Explain about header files used in c language?

list of header files in c and function prototype associated with each file


What is the header files from random functions?

The header file for random functions ( like rand(), srand() ) is stdlib.h in C and cstdlib in C++.


How do you create a header file and implementation of code in another c file and both should be retrieved by another .c file?

tanga


More about hedder file in c?

For start: they are header files.


How can you create a header file in c?

Use a text-editor.


What is conio. h?

conio.h is a header file used in C and C++ programming, particularly in DOS-based systems. It provides functions for console input and output, such as gotoxy() for cursor positioning and clrscr() for clearing the screen. Although it was widely used in older compilers like Turbo C++, it is not part of the standard C library and is largely considered obsolete in modern programming environments.


How do you include a system header file called sysheader.h in a c source file?

There is no system header called share.h, but if there were, it would be: #include &lt;share.h&gt;


A function is declared in C header file When you try to implement in a c source file it is giving error?

The source file must include the header file. Beyond that we can only guess at the problem without seeing the content of the source and header files. Do not post the files here. Such questions are better handled by the many C programming forums available elsewhere on the Internet.

Trending Questions
What is an advantage of using styles in documents? Almost all of the electrons flowing through a battery circuit come from what? Technician a says the labor manuals guide to average amount of time a job will take technician B says the labor manual specifics the dollar amount to charge the customer who is correct? Who developed the internet website language HTML and when? Is kirchofs law is concerrned with junction voltages? What is the flowchart for swapping two variables? What is the difference between HT and LT line? Writ a c plus plus program a function intersect() with four float parameter m1b1m2b2.the function returns 1 if the two Line intersect. otherwise should return 0.? What is redundant code in object oriented programming language? What are the disadvantages of scope resolution operator? What is the sum of 365 and115? What is the procedures for reporting discrepancies in the data or documents and for reporting lost or damaged drawings and documents? can plumbing go through joists? Write a program that accepts a word in uppercase and prints it in lowercase? What involves creating representations of complex objects or processes? How will you locate the fault in pre amplifier? How does a 'string' type string differ from a c-type string? How can you add numbers in base n? What is the difference between a electrical technician and electrician? Who was the famous German mathematician who invented the one sided strip of paper that is now used for conveyor belts?