Thread: dynamic array

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    94

    dynamic array

    i am trying to create the following dynamic array :
    Code:
    char *someArr[x] = new char [y];
    where both x and y are not constants and need to be changed within the fnct. is there any way of doing this?


    thanx sophie

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Try this:

    Code:
    char *someArr;
    y = GetSize ();
    someArr = new char [y];

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    94
    no good...that creates a one dimentional array...mine needs to be multidimentional
    simple is always an understatement.....

  4. #4
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    Originally posted by Salem
    You're not going to believe this!
    WOW!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dynamic Array Resizing
    By dld333 in forum C++ Programming
    Replies: 13
    Last Post: 11-04-2005, 12:13 AM
  2. need help with dynamic array syntax
    By soldyne in forum C Programming
    Replies: 3
    Last Post: 10-11-2005, 01:59 PM
  3. Class Template Trouble
    By pliang in forum C++ Programming
    Replies: 4
    Last Post: 04-21-2005, 04:15 AM
  4. 2D dynamic array problem
    By scsullivan in forum C Programming
    Replies: 3
    Last Post: 12-30-2002, 10:02 PM
  5. Dynamic array allocation and reallocation
    By purple in forum C Programming
    Replies: 13
    Last Post: 08-01-2002, 11:48 AM