Dynamic Array Size

Discussion in 'C Programming' started by Manoj Jangid, Dec 4, 2007.

  1. Manoj Jangid

    Manoj Jangid Guest

    Hi to all,

    Is there any way to define array size dynamically in C without using
    malloc or calloc ?

    Kind Regards

    Manoj
    Manoj Jangid, Dec 4, 2007
    #1
    1. Advertising

  2. Manoj Jangid

    Guest

    On Dec 4, 10:14 am, Manoj Jangid <> wrote:
    > Hi to all,
    >
    > Is there any way to define array size dynamically in C without using
    > malloc or calloc ?

    You can also use realloc(NULL, n); or a variable length array (C99
    only)
    , Dec 4, 2007
    #2
    1. Advertising

  3. Manoj Jangid wrote:
    > Hi to all,
    >
    > Is there any way to define array size dynamically in C without using
    > malloc or calloc ?


    realloc
    Martin Ambuhl, Dec 4, 2007
    #3
  4. Manoj Jangid

    Manoj Jangid Guest

    On Dec 4, 1:14 pm, Manoj Jangid <> wrote:
    > Hi to all,
    >
    > Is there any way to define array size dynamically in C without using
    > malloc or calloc ?
    >
    > Kind Regards
    >
    > Manoj


    sorry I mean without using any memory allocation

    Kind Regards

    Manoj Jangid
    Manoj Jangid, Dec 4, 2007
    #4
  5. Manoj Jangid

    santosh Guest

    Manoj Jangid wrote:

    > On Dec 4, 1:14 pm, Manoj Jangid <> wrote:
    >> Hi to all,
    >>
    >> Is there any way to define array size dynamically in C without using
    >> malloc or calloc ?
    >>
    >> Kind Regards
    >>
    >> Manoj

    >
    > sorry I mean without using any memory allocation
    >
    > Kind Regards


    How can you "allocate" something without doing any "allocation"? What
    are trying to do? If you can describe the actual problem you are trying
    to solve, then it may be that it is possible to solve without jumping
    through hoops.
    santosh, Dec 4, 2007
    #5
  6. Manoj Jangid

    echo.sj Guest

    On Dec 4, 4:14 pm, Manoj Jangid <> wrote:
    > Hi to all,
    >
    > Is there any way to define array size dynamically in C without using
    > malloc or calloc ?
    >
    > Kind Regards
    >
    > Manoj


    C99 variable length array
    echo.sj, Dec 5, 2007
    #6
  7. Manoj Jangid

    Manoj Jangid Guest

    On Dec 5, 8:35 pm, "echo.sj" <> wrote:
    > On Dec 4, 4:14 pm, ManojJangid<> wrote:
    >
    > > Hi to all,

    >
    > > Is there any way to define array size dynamically in C without using
    > > malloc or calloc ?

    >
    > > Kind Regards

    >
    > > Manoj

    >
    > C99 variable length array


    Thanks...
    Manoj Jangid, Dec 6, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Madhanmohan S
    Replies:
    5
    Views:
    7,739
    Madhanmohan S
    Sep 3, 2004
  2. Replies:
    5
    Views:
    547
    Flash Gordon
    Apr 9, 2006
  3. Replies:
    8
    Views:
    503
    Bob Hairgrove
    Apr 10, 2006
  4. =?Utf-8?B?Sm9l?=

    how to dynamic assign two dimensions array size

    =?Utf-8?B?Sm9l?=, Mar 15, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    312
    Alexey Smirnov
    Mar 15, 2007
  5. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,567
    Michael Jung
    May 25, 2008
Loading...

Share This Page