can anyone tell me how to use gotoxy and clrscr in dev c++ compiler..i have tried many unfortunately not working....:(
have you included necessary header files
@iamcj- unfortunately no header files exits....
dev c++ has no header files like stdio.h or conio.h??
nope there are header files but none have the gotoxy included in them
gotoXY is a graphical function and in standard c++ it is generally defined in graphics.h file..
i will try that
got it... in dev c++ you have to give your own header files... it doesnot come with its own.... it asks during every start up
not working....
@iamcj- it has stdio.h,stdlib.h......it doesn't only support the gotoxy function which essential for the graphics driven programs..i tried writing own header files but not working...:(
there are many other compilers available.... try them... many are open source..
they have graphics.h ,, even turbo c++ has graphics.h
to use clrscr in c++, you must use a header file #include<conio.h>
for "clrscr();" you may use "system("cls"); but you need to include conio.h. for gotoxy() it's a bit more complicated to explain. Here's a working example: #include <stdio.h> #include <conio.h> #include <windows.h> void main() { HANDLE consHandle; COORD consCoord; consHandle = GetStdHandle(STD_OUTPUT_HANDLE); consCoord.X = 30; //coord x consCoord.Y = 10; //coord y SetConsoleCursorPosition(consHandle, consCoord); //gotoxy replacement printf("Hello World\n\n"); _getch(); }
i tried inserting the above function module but its all vain...
Join our real-time social learning platform and learn together with your friends!