Thread: Loading an Array for manipulation

  1. #1
    random number generator reRanger's Avatar
    Join Date
    Oct 2004
    Posts
    44

    Loading an Array for manipulation

    Hello:
    Earlier I learned from members of this board their suggestions of string parsing that would result in tokens based on observing white spaces; I have been researching how to load these tokens into an array once detected and determined. How do I take the token AFTER it is culled from a string and assign it to an array for further manipulation? Any help would be greatly appreciated.

    reRanger
    "Nay! But you love the present life!"

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well a C oriented answer would be something like
    Code:
    char **tokens;
    followed by lots of memory allocation.

    A nice C++ answer would be
    Code:
    vector<string> tokens;
    Whilst neither is a true array, both support [index] subscripting.

  3. #3
    random number generator reRanger's Avatar
    Join Date
    Oct 2004
    Posts
    44

    :)

    TY Salem
    "Nay! But you love the present life!"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Little Array Difficulty
    By G4B3 in forum C Programming
    Replies: 16
    Last Post: 03-19-2008, 12:59 AM
  2. Modify an single passed array element
    By swgh in forum C Programming
    Replies: 3
    Last Post: 08-04-2007, 08:58 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. Struct *** initialization
    By Saravanan in forum C Programming
    Replies: 20
    Last Post: 10-09-2003, 12:04 PM
  5. Array Program
    By emmx in forum C Programming
    Replies: 3
    Last Post: 08-31-2003, 12:44 AM