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

Answer Posted / shalabh

This can be done by using malloc...if u have an integer
array then ...you can ask user the size..and then allocate
memory for integers...at the run time...using malloc()

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between class and unio?

2100


What is the Purpose of 'extern' keyword in a function declaration?

852


What is the size of enum in c?

838


What is function prototype in c language?

808


what are non standard function in c

1646


Is there a way to compare two structure variables?

843


What is bash c?

763


Write a program of prime number using recursion.

831


what is use of malloc and calloc?

1651


What is use of pointer?

780


what is the structure pointer?

1857


What does it mean when a pointer is used in an if statement?

858


the question is that what you have been doing all these periods (one year gap)

1856


Why is event driven programming or procedural programming, better within specific scenario?

2166


If you know then define #pragma?

871