CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@confounded • 26 Jan, 2009
I have a question... how i can get input from the user in graphics mode. I want the cursor placed directly after "Enter number here: " but I'm not able to do that using cin. even the gotoxy statement doesnt work in graphics mode. Is there any other function i should use?

Also how can i display the number using outtextxy...it takes only string as argument?

Here is my code:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>

int main()
{
int num;
int gd=DETECT, gm;
initgraph(&gd,&gm,"c:\\tc\\bgi");
settextstyle(1,0,2);
outtextxy(100,100,"Enter number");
cin>>num;
outtextxy(100,200," The number is: ");
cout<<num;
getch();
closegraph();
}
@confounded • 26 Jan, 2009 okay i was extremely stupid...😒

I should have given smaller numbers for gotxy arguments...oops.
Anyway now that problem is solved.
@Adwait • 08 May, 2016 I see....
I have created a function in c++ which can be used to take input in graphics mode.

If you want that please contact me on my email id. I will send you.

My email id: adwaitthattey@gmail.com
2.4k views

Related Posts

@kanwar singh · Aug 31, 2012

Thoughtworks is visiting our campus and I'm looking for aptitude papers and programming questions. It'd be nice if someone can provide me with a sample test papers for their first...
10.8k views

@Kaustubh Katdare · Mar 23, 2010

Communication engineers, please help me understand the difference between EV-DO and CDMA 1X. I'm totally clueless.
8.1k views

@BCA_GIRL · Oct 16, 2010

What are the differences between Serial schedule and Serializability? As i concerned, a schedule is said to be Serial if all the operation of transaction executes consicutively without any interference...
8.4k views

@Ankita Katdare · Jun 9, 2014

In the Cognitive Anteater Robotics Laboratory (CARL) at the University of California, Irvine, a team of researchers led by Jeff Krichmar, professor of cognitive science, is developing what are being...
6.3k views

@arsh86 · Mar 23, 2009

i need a suggestion here are many course like catia, pro-e, solid works. which course should i prefer??? 😀
2.1k views