NULL terminating a multi dim char array

This is a discussion on NULL terminating a multi dim char array within the C++ Programming forums, part of the General Programming Boards category; I am trying to write a small tic tac toe game using a char array and I was wondering if ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    60

    Question NULL terminating a multi dim char array

    I am trying to write a small tic tac toe game using
    a char array and I was wondering if I need to allow for
    a '\0'? Thanks for any advice.

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    NULL terminators are only used in string, so unless your tic-tac-toe field is a string (why would it be? ) you don't need it.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Feb 2003
    Posts
    60

    Thumbs up

    Um.. Yeah! I think I naturally associate any character array with strings, that's where I got confused. The array will hold characters that the user chooses as their token for the game. The whole thing will be three classes. CBoard, CPlayer and CTracker.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 04:42 PM
  2. How do i un-SHA1 hash something..
    By willc0de4food in forum C Programming
    Replies: 4
    Last Post: 09-14-2005, 05:59 AM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  5. opengl program as win API menu item
    By SAMSAM in forum Game Programming
    Replies: 1
    Last Post: 03-03-2003, 06:48 PM

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