could anyone tell me what are the max values that can be entered in turbo c++ gotoxy function.....
the help says that (35,25) is the bottom right position in the window but i can enter text even upto x-coordinate 50..
what i want to do is enter text at y- coordinates greater than 25....
is this possible ???
plese help.... i have a project to submit within a week and this is a mojor roadblock.... :S

maximum is the size of the screen and its resolution, usually 25 x 80. The 35X25 was common when PCs first came out in the early 1980s. But MS-Windows console screens have much smaller fonts and more rows.

could anyone tell me what are the max values that can be entered in turbo c++ gotoxy function.....
the help says that (35,25) is the bottom right position in the window but i can enter text even upto x-coordinate 50..
what i want to do is enter text at y- coordinates greater than 25....
is this possible ???
plese help.... i have a project to submit within a week and this is a mojor roadblock.... :S

Try it... Do larger numbers work? If so, fine. If not, you'll know that, too.

hey ..thanx for the info...i cant use gooxy to ge info from lower portions of the screen

So i replaced the gotoxy function with this

do
        {  occupation[++i]=getch();
           if(occupation[i]==8)
           {
             setcolor(WHITE);
             outtextxy(160,210,occupation);
             strcpy(occupation,"               ");
             setcolor(BLACK);
             i=-1;
            }
           outtextxy(160,210,occupation);
        }while(occupation[i]!=13);
        i=-1;
        do
        {  age[++i]=getch();
           if(age[i]==8)
           {
             setcolor(WHITE);
             outtextxy(160,180,age);
             strcpy(age,"       ");
             setcolor(BLACK);
             i=-1;
           }
           outtextxy(160,180,age);
        }while(age[i]!=13);

this is just a small part in which a user enters his gender and age
the if part checks for backspce and if backspace is entred it deletes the enitre line and you can enter it again.....

Problem is :
It works PERFECTLY for the gender but if i backspace the age the program just moves on to the next value to be entered without letting me re-enter the age

I even tried copying the exact code and replacing the variables and outtextxy position but the code just doesnt work for the age variable

Both gender and age are strings : gender[5], age[2]

PLEASE HELP :icon_sad:

you don't really need those loops at all if you use fgets() to get the entire line at one time instead of one character at a time with getch(). It also processes backspace correctly, which your code does not.

>>Both gender and age are strings : gender[5], age[2]

Make sure the buffers are at least as large as needed to hold all the characters plus the null terminator. If you want age to hold two digits then it needs to be a minimum of 3 bytes. gender needs to be at least 7 because "female" is 6 characters.

what does 25x80 stand for ?
my computer's screen resolution shows 1024*768

1024*768 is the size of the screen in graphic pizels

25x80 is the text mode screen size (25 lines and 80 characters per line). That was the default size of the old MS-DOS version 6.X and earlier screens.

normally size in C is 25x80

normally size in C is 25x80

There is no such thing as a "normal size in C". C language doesn't know a thing about screen sizes.

hi guy I use borland C++ and I have Question :
Q : can anyone tell me what include gotoxy needed??

i want a code to input text on a fixed coordinates onthe screen say(250,200)
what should i use in turbo c++

First off, please do not hijack threads from years gone by, even if they are related to your question. In the future, you would do better to start a new thread for your subject.

Second, Turbo C++ has no direct support for modern fonts as far as I know, and the bitmap fonts it did support are poorly documented. this thread discusses the difficulties you are facing trying to use <graphics.h> for text.

Keep in mind, you are using a DOS mode compiler that is now 25 years old. It is no longer even usable under Windowd Vista/7/8, without special emulation. If you can, I would strongly recommend using a different compiler and IDE, such as Code::Blocks.

I don't think he's asking to change the font, just to input text at specific coordinates. All sahil needs are these two lines.

gotoxy(x,y)
fgets(text,sizeof(text),stdin);

Ah, I had been of the impression that gotoxy() was a console mode function; I didn't think it would work for text in a graphics mode application (which the particular coordinates mentioned implied). If I was wrong in that, I apologize.

gotoxy is indeed a text mode function. You didn't say you wanted graphics mode so I assumed you wanted text mode. My error. I don't know enough about graphics.h to tell you what to do, I haven't used that compiler in over 20 years.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.