How can I set an array's size at run time?

Answer Posted / vijay zanvar

You can't do that in C. Use dynamic allocation method
to implement array. See Q. 20 and 41 in
http://www.geocities.com/vijoeyz/faq/

Best,
Vijay Zanvar,
Home Page - http://geocities.com/vijoeyz/

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are the standard predefined macros?

655


Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?

693


Write the syntax and purpose of a switch statement in C.

631


Can the sizeof operator be used to tell the size of an array passed to a function?

622


What is meant by recursion?

636






What is a char in c?

559


What does *p++ do?

593


Can two or more operators such as and be combined in a single line of program code?

813


What does typeof return in c?

640


What is a const pointer in c?

675


Is calloc better than malloc?

584


What is an lvalue?

638


Explain what header files do I need in order to define the standard library functions I use?

651


What is an expression?

661


What is the scope of local variable in c?

582