On 8/18/06, alex_merlin_1985 <[EMAIL PROTECTED]> wrote:

> I'm trying to make a type sequence in a program made in BGI mode,
> but it doesn't work fine. The purpose is that the user is asked to
> type in his name and to get that in a string. Like this:

I recommend you get rid of Turbo C++ and upgrade to Dev-C++ or Visual
C++ Express -- they are free and they are modern... Turbo C++ is very
outdated. Both of these compilers support Windows development, as well
as console applications.

> #include <conio.h>
> #include <graphics.h>
>
> void main()
> {
>     int i;
>     char key;
>     outtextxy(100,100,"Type in your name:");
>     while(key!=13)//enter is pushed
>     {
>         outtextxy(220+i,100,&key);
>         i+=10;//increment the position where th new char is output
>     }
> }
>
> The point is that it works fine, but it displays an extra char with
> each character I input. For example:
> -I type "a", but it displays: a@(or something that looks like @)

I don't see where you are actually capturing the keyboard input. Are
you using fgets()?

-- 
Brett McCoy: Programmer by Day, Guitarist by Night
http://www.alhazred.com
http://www.cassandrasyndrome.com
http://www.revelmoon.com


To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/c-prog/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to