Array question

This is a discussion on Array question within the C++ Programming forums, part of the General Programming Boards category; hey guys just wondering if when you put a word in a character array is this still classed as dealing ...

  1. #1
    182
    182 is offline
    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,807
    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,338
    What didn't you understand about the answers you got in the previous thread?

    Array question

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, 06: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, 05:27 PM

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