Thread: Program Troubles...

  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

  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, 10:58 PM
  3. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  4. Replies: 2
    Last Post: 05-10-2002, 04:16 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM