Thread: Multiple Problems( window(), gotoxy(), & getchar() )

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    51

    Multiple Problems( window(), gotoxy(), & getchar() )

    Ok, I am writing a program for a school project, and the teacher just told us that we could not use functions that are not ansi compliant. I have used window() and gotoxy() all over the place, and was wondering if there was and any way to accomplish the same things using parts of the standard library.

    Second Problem.
    After getting the bad news, I changed all of my getch() to getchar(), but I am getting some crazy results. I have a basic menu that uses a function to get the choice and return it. It's acting like it's getting back 2 characters, and jumping past the sub menus.

    Any ideas would be helpful. Thanks all.

  2. #2
    Registered User
    Join Date
    Feb 2002
    Posts
    51
    Ok, I figured out the getchar() problem, but still looking for any ideas on window() and gotoxy(). I know I can jump down the screen using loops, but if I do that it will clear what is already on the screen. Also, it will not provide me with a way to move back up.

    As always, any help is greatly aprreciated.

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    windows and gotoxy are not ANSI compilent because they are not console functions but are rather really old GUI programming functions that come out of the antiquated graphics.h Borland specific library.

    In this day in age the Microsoft Operating System requires that you target Win32 dll's tied to GDI in order to access video hardware. They also use DirectX API.

    In order to meet the requirements of ANSI realize that you are writing a console program and you must deal with the screen lines sequentially. You have to use loops to draw the screen one line at a time. If you have to update the screen than you should put most of the drawing in a function and call that function after clearing the screen and changing the variables. I have no real idea of what your program assignment specification is however so I don't know how to answer the question, but those are a few things anyway from what I could decifer of your situation.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2 Window Problems
    By P4R4N01D in forum Windows Programming
    Replies: 10
    Last Post: 01-24-2008, 10:51 PM
  2. creating a child window
    By rakan in forum Windows Programming
    Replies: 2
    Last Post: 01-23-2007, 03:22 PM
  3. input/output
    By dogbert234 in forum Windows Programming
    Replies: 11
    Last Post: 01-26-2005, 06:57 AM
  4. Adding colour & bmps to a Win 32 Window??
    By carey_sizer in forum Windows Programming
    Replies: 4
    Last Post: 09-04-2004, 05:55 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM