Thread: Arrays/strings

  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    55

    Arrays/strings

    I want to get a string from input but I don't want to waste any space by declaring a char array with elements that may not be used. A pointer to char wouldn't be much different I assume. So what are my options here?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Your options are:
    1. Declare a char array with enough space.
    2. Write an entirely new string library from scratch that automatically resizes itself.

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    55
    Heh, that's what I was afraid of.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginners question about arrays/strings
    By Wiretron in forum C Programming
    Replies: 2
    Last Post: 11-07-2005, 03:34 PM