473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

CLRSCR(); and GOTOXY();

Why I can't use the clrscr(); and gotoxy(); in some compilers?
May 4 '07 #1
10 50133
ajayraj
21
Why I can't use the clrscr(); and gotoxy(); in some compilers?

There are few functions which are available in some compliers but not the others.

say the example :- The functions 'void, clrscr() etc are not in ANSI C++, while it is supported by turbo c++.

Now say
_setcursortype(_NORMALCURSOR);
this function is not available in in early releases Turbo C(like 2.0), but was in some later releases, I think..

Now here ...................
Now this clrscr() is declared under #include <conio.h>.
Now if u are using GCC, then it does not contain a C library, it just uses the library (headers included) that come with the OS.
i.e. these most functions are compiler as well as OS dependent and it changes even in versions of the same compiler.
Hope it cleared ur doubts...
May 4 '07 #2
Is conio.h included in all compilers?
May 4 '07 #3
svlsr2000
181 Expert 100+
Is conio.h included in all compilers?
Simple answer No.......
May 4 '07 #4
ajayraj
21
Is conio.h included in all compilers?

Most of the compilers support conio.h,
but there are few complier like Dev-C++ which provide conio.h but with reduced functionality,
say it dont have clrscr().

Most of compliers support gotoxy(x,y) function. (But , of cource, not Win32 GUI )
There is no guarantee that all compilers support non-ANSI functions.
May 4 '07 #5
AdrianH
1,251 Expert 1GB
conio is a library which is not really standard. If the library is open source, you may be able to download and compile your own. If it is not, you may be able to get a binary and header for it. Some compilers have it already out of the box, while others do not.

If you use conio, or any other non-standard library, beware if you are hoping to move you app over to another compiler or platform. It may not be possible without a lot of tweaking. Sometimes it is a good idea to use an intermediate library. ncurses is a fairly standard open source one.


Adrian
May 4 '07 #6
Hello my main problem is all about the clrscr(); and gotoxy();. How can I use it in Dev cpp :)
May 4 '07 #7
AdrianH
1,251 Expert 1GB
Hello my main problem is all about the clrscr(); and gotoxy();. How can I use it in Dev cpp :)
If you looked around using a search engine, you would have come up with this:
http://aditsu.freeunixhost.com/dev-cpp-faq.html#conio. Check it out.


Adrian
May 4 '07 #8
i use it in dev-c++
hope it works in other compiler that u use...
but it need windows OS to run...

#include <iostream>
#include <windows.h>

using namespace std;

void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
}

int main()
{
gotoxy(20, 10);
cout<<"Brawijaya Computer Science"<<endl;
gotoxy(20, 11);
system("PAUSE");
return 0;
}
May 30 '07 #9
gh0sst
2
hello !

when i compine that code in dev-cpp i get the following error:

11 C:\Dev-Cpp\bin\trivia\tmp.cpp `STD_OUTPUT_H' undeclared (first use this function)
Jun 10 '08 #10
hello !

when i compine that code in dev-cpp i get the following error:

11 C:\Dev-Cpp\bin\trivia\tmp.cpp `STD_OUTPUT_H' undeclared (first use this function)
its because of this line
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_H ANDLE), coord);
it should be STD_OUTPUT_HANDLE without a space on H and ANDLE
Feb 4 '09 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: AHR | last post by:
Hi NG I am learning MFC but only use the command promt at the moment to run my C++ programs. My problem is that i cant use clrscr() even if i include <conio.h>. I get this error: ****
4
by: Teo81 | last post by:
Hi! I'm using visual studio 6.0 and I need to interact with DOS console. I know the conio.h library but, under visual studio, it doesn't provide useful functoins like gotoXY( int, int ) etc.... My...
5
by: Deep | last post by:
Is there any alternative for gotoxy and similar functions in gcc??
6
by: arunk8186 | last post by:
Hi friends, When I compiled a program in which I have used gotoxy function in C , I get an error as "C:\Documents and Settings\e373616\Desktop\H1.cpp(58) : error C2065:...
8
by: Michele 'xjp' | last post by:
Hi there, I am using a POSIX-compliant system, Cygwin on Windows. I need the features of conio.h's getch() and clrscr(), but I can't compile programs with #include <conio.h(since conio.h is NOT...
26
by: Albert | last post by:
Hi Are there any definitions of the gotoxy function on the internet. My compiler doesn't define it in any header Albert
5
by: poopsy | last post by:
hi all i wud like to know wat is the equivalent of gotoxy(x,y) in C++?? i found that in many codes on the net wat's the function of gotoxy..can sumbody plz explain i've never done C, ive always...
5
by: Abhishek170 | last post by:
hello everyone, i'm just a beginner in C language. just wanted to ask wich include will i have to use while using gotoxy and clrscr or is there any link/site where i check all the functions in all...
2
by: naughtysriram | last post by:
what are the equivalent library functions found in conio.h (turbo c++) for other gnu c++ variations.. i need functions like gotoxy(), clrscr(), getch()...etc. thanks in advance
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.