Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / vinod

C99 and above supports the conceptof VLA(Variable Length Array) which allows you to set array size based on input during run time. It can also done using dynamic memory allocation.

Example:
int main()
{
int i;
scanf("%d",&i);
int a[i];
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is volatile, register definition in C

1105


What is the difference between array_name and &array_name?

1298


hi any body pls give me company name interview conduct "c" language only

2280


Do array subscripts always start with zero?

1299


How can I rethow can I return a sequence of random numbers which dont repeat at all?

1190


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

1242


What are global variables?

1184


What is the difference between a string and an array?

1205


Is there a way to switch on strings?

1085


How we can insert comments in a c program?

1122


regarding pointers concept

2037


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1391


Why do we use header files in c?

1071


What is structure padding and packing in c?

1067


write a program fibonacci series and palindrome program in c

1040