Thread: Dividing array by scalar

  1. #16
    Novice
    Join Date
    Jul 2009
    Posts
    568
    Variable-length array. Is a (relatively) new feature of C. Some of the ye olde compilers don't support it.

    What it boils down to is you can use variables when declaring an array, whereas before it had to be a constant (expression). Like this.
    Code:
    int n;
    scanf( "%d", &n );
    data[n];

  2. #17
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    I can't do that - I feel cheated, and the government owes that to me!!

    I want my VLA!

  3. #18
    Registered User Char*Pntr's Avatar
    Join Date
    Sep 2007
    Location
    Lathrop, CA
    Posts
    198

    Question

    Quote Originally Posted by Adak View Post
    I can't do that - I feel cheated, and the government owes that to me!!

    I want my VLA!
    But will Turbo C support VLA?

  4. #19
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Well it better - I've waited long enough!!

    Congress should DO something about this!

  5. #20
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Adak View Post
    I can't do that - I feel cheated, and the government owes that to me!!

    I want my VLA!
    smorgasbordet - Pelles C

  6. #21
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Pelles is a great suggestion. I have a few programs to tidy up first - then I'll give it a try.

  7. #22
    Novice
    Join Date
    Jul 2009
    Posts
    568
    In my limited experience, you're not missing out on much. If I need dynamic anything, I malloc() it. I just don't see the advantage. Maybe it's due to my inexperience.

  8. #23
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by msh View Post
    In my limited experience, you're not missing out on much. If I need dynamic anything, I malloc() it. I just don't see the advantage. Maybe it's due to my inexperience.
    Well there's a lot more than VLA to reccomend Pelles-C ...
    I'm waiting till Adak sees the libraries...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multidimensional Array Addressing
    By BlackOps in forum C Programming
    Replies: 11
    Last Post: 07-21-2009, 09:26 PM
  2. Replies: 16
    Last Post: 05-29-2009, 07:25 PM
  3. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  4. Quick question about SIGSEGV
    By Cikotic in forum C Programming
    Replies: 30
    Last Post: 07-01-2004, 07:48 PM
  5. Array Program
    By emmx in forum C Programming
    Replies: 3
    Last Post: 08-31-2003, 12:44 AM