Thread: my first windows console program

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    203

    my first windows console program

    this is the first program i have written using windows console commands (can i get a better technical term?). Displays happy birthday and a persons name, then starts to display it randomly. It is written for a female, but that is easily changed. I could probably make it customizable if i added another 10 or so lines of code

    feel free to take a look and modify it however you like. Please make any suggestions you want, but remember it is my first program using windows console stuff (that sounds stupid!!! i need to know what it's called). I need to know what things i'm doing wrong before i can learn to do them right.

    pressing space will pause (press anykey to continue)
    pressing enter will clear the screen (and continue if paused)
    pressing escape quits (even if paused)

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    203
    eh i just noticed i forgot 1 thing

    if(count == 100)
    {
    clrscr();
    count = 0; //forgot to reset the count
    }

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571
    When you dynamically allocated your memory...

    CHAR_INFO *hbout = new CHAR_INFO[hblen+2];
    CHAR_INFO *nameout = new CHAR_INFO[namelen+2];

    You forgot to delete the memory. To remedy this simply add the following two lines of code when your arrays are no longer needed by anything.

    delete [] hbout;
    delete [] nameout;

  4. #4
    Registered User VBprogrammer's Avatar
    Join Date
    Mar 2002
    Posts
    175
    Most pll call it a "console mode app" but call it whatever you like, i would tell you some of my personal favourites but the Mods would just edit it!
    VC++ 6

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. Client-server system with input from separate program
    By robot-ic in forum Networking/Device Communication
    Replies: 3
    Last Post: 01-16-2009, 03:30 PM
  3. Program works on Windows XP and 2000, not on 98 or ME
    By MidnightlyCoder in forum C++ Programming
    Replies: 7
    Last Post: 03-10-2006, 03:36 PM
  4. Controlling windows not created by the C++ program
    By Aelstro in forum Windows Programming
    Replies: 2
    Last Post: 04-05-2003, 12:34 PM
  5. Windows Console!
    By Perica in forum Windows Programming
    Replies: 15
    Last Post: 10-18-2002, 08:08 PM