You are here:

C/String acceptence in graphics mode..

Advertisement


Question
In C/C++ if i would want to create a form which would accept strings and save the string in a file,when operating in the graphics mode how do i do it?
Or
Suppose i want a to create a su-do-ku game where a person can click on a particular position (in graphics mode again)and enter nos how do i make it accept the entered nos before checking for correctness?

Answer
Hai dear Shruthi !

Happy new year !

 IN graphics mode very well you can use the printf and scanf() functions in case of scanf() function , it won't display the blinking cursor instead you have to enter the values where there is no cursor to point to on which place to enter the values on screeen , a handy solution for this issue is you can use gotoxy() function to resolve the cursor position , in this case you can virtually set the cursor location where you supposed to get the input

eg

gotoxy(10 ,10);
scanf("%d", &n); this code would virtually fix the screen cursor at 10th row and 10th column ( but there will be no blinking cursor to reflect the change) once if you enter some value it will be picked up at 10th row and 10th column

Thanks and Regards !
Prince M. Premnath  

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.