Program Troubles...

This is a discussion on Program Troubles... within the Windows Programming forums, part of the Platform Specific Boards category; My program crashes when I try to print; got any thoughts? Thanks...

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052

    Program Troubles...

    My program crashes when I try to print; got any thoughts?

    Thanks
    Attached Files Attached Files

  2. #2
    Me want cookie! Monster's Avatar
    Join Date
    Dec 2001
    Posts
    680
    In your print function:

    char* buff = "Roster Starts at: ";

    You have created a const character array with size 19. First of all, you can't change this array because it's const. Second, the size of the buffer is not large enough to hold the complete string. Make sure the buff array is large enough:
    Code:
    char buff[BUFSIZ];
    strcpy(buff, "Roster Starts at: ");
    And use strcat if you want to add strings...

    Cheers,
    Monster

  3. #3
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    oh, woops. I forgot about changing the way I declared it when I added all he strcpy()'s underneath

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. BOOKKEEPING PROGRAM, need help!
    By yabud in forum C Programming
    Replies: 3
    Last Post: 11-16-2006, 11:17 PM
  2. Can someome help me with a program please?
    By WinterInChicago in forum C++ Programming
    Replies: 3
    Last Post: 09-21-2006, 11:58 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 08:51 AM
  4. Replies: 2
    Last Post: 05-10-2002, 05:16 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 11:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21