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

What are the disadvantages of c language?

625


Explain how do you determine whether to use a stream function or a low-level function?

634


What does the error 'Null Pointer Assignment' mean and what causes this error?

750


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2544


how to write optimum code to divide a 50 digit number with a 25 digit number??

2761






Which of these functions is safer to use : fgets(), gets()? Why?

640


What is derived datatype in c?

643


What is s or c?

605


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

658


write a program to find out prime number using sieve case?

1647


What is the difference between abs() and fabs() functions?

614


What are derived data types in c?

622


Which header file is used for clrscr?

588


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1598


What do you mean by scope of a variable in c?

554