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

if p is a string contained in a string?

1407


How do you determine the length of a string value that was stored in a variable?

652


Explain what does a function declared as pascal do differently?

645


What are 'near' and 'far' pointers?

624


Which one would you prefer - a macro or a function?

606






What is static memory allocation?

611


What does s c mean on snapchat?

590


Explain how are portions of a program disabled in demo versions?

657


What is return type in c?

644


There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?

827


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

1474


What is a buffer in c?

578


Why clrscr is used in c?

591


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

631


Explain the properties of union.

615