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

How do we print only part of a string in c?

819


What is volatile, register definition in C

902


What is wild pointer in c?

816


What are the advantages and disadvantages of c language?

786


Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014  Npu university

1829


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

849


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist

2726


What are the 3 types of structures?

790


What is a newline escape sequence?

876


Are pointers integer?

772


What are terms in math?

810


What is c language used for?

737


Why we use break in c?

771


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1036


Explain the use of 'auto' keyword

891