array size??

This is a discussion on array size?? within the C Programming forums, part of the General Programming Boards category; Hi out there, is there a possibility to create an array without defining the exact size of it??? Thanks in ...

  1. #1
    Registered User
    Join Date
    Jan 2002
    Posts
    2

    array size??

    Hi out there,

    is there a possibility to create an array without defining the exact size of it???

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    2
    hey great thanks a lot

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    You need an array that grows. Start out with a small array that is dynamically allocated and read input character by character. When the array's size is met than reallocate another block of memory.

    malloc
    realloc

    Go here: http://www.research.att.com/~bs/papers.html

    And look at the article 'Learning Standard C++ As A New Language'. It will be worth reading.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. size of array
    By goran00 in forum C Programming
    Replies: 38
    Last Post: 04-02-2008, 10:57 AM
  2. Invalid conversion from 'void*' to 'BYTE' help
    By bikr692002 in forum C++ Programming
    Replies: 9
    Last Post: 02-22-2006, 11:27 AM
  3. Replies: 42
    Last Post: 12-19-2004, 08:59 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  5. Type and nontype parameters w/overloading
    By Mr_LJ in forum C++ Programming
    Replies: 3
    Last Post: 01-02-2004, 01:01 AM

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