Thread: Array question

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    133

    Array question

    hey guys just wondering if when you put a word in a character array is this still classed as dealing with a character string?

    for example

    if i had a char array which was char example [100];

    and it contained "hello" would hello be classed as a string even though its in a char array?

    thanks.

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Yes. Well yes.
    Woop?

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    32
    Not always, if you are attempting to make an actually array of characters and not a string. then you need to leave off a null termination character "\0" otherwise it will be treated as a string.

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    What didn't you understand about the answers you got in the previous thread?

    http://cboard.cprogramming.com/showthread.php?t=78594

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dynamic Mutli dimensional Array question.
    By fatdunky in forum C Programming
    Replies: 6
    Last Post: 02-22-2006, 07:07 PM
  2. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 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. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  5. array question?
    By correlcj in forum C++ Programming
    Replies: 1
    Last Post: 11-08-2002, 06:27 PM