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
4.1k views

Related Posts

@silenthorde · Jul 18, 2009

Can anyone explain Diffusion Capacitance of a PN juntion diode. All I know is that it comes into play when the diode is Forward biased and increases exponentially with increase...
4.2k views

@NAVATHE SACHIN · Aug 21, 2012

what is the exact difference between centrifugal clutch and manual clutch and also which one is better to use in vehicles?
4.6k views

@Kaustubh Katdare · Oct 6, 2008

CEans, Has anyone among us had a chance to try out Yamaha FZ16? If yes, could you please post a review (covering all the technical/non-technical) aspects of the motorcycle?
5.7k views

@Chaitanya Kukde · Sep 28, 2014

LED systems are already a hot property all over the world. From portable electronics, smartphones to home lighting solutions, LEDs can replace conventional lighting in almost all areas. A recent...
6.2k views

@*pushkar* · Jun 25, 2011

Please suggest from your experience. These days i am preparing for the placements. Should i do quant question also.? what should i prepare for Tech Interview , i am from...
3.4k views