Answer Posted / lp
Declare a integer array size at runtime:
1.declare an interget pointer. - int *ptr
2.Get the size of array from user - int n
3.using malloc() ,allocate that many number of location to
the pointer. - ptr = malloc(n*sizeof(int));
4.Make use of the dynamically allocated array. - ptr[]
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is non linear data structure in c?
What is FIFO?
Is c dynamically typed?
Explain the difference between ++u and u++?
Can we use any name in place of argv and argc as command line arguments?
If fflush wont work, what can I use to flush input?
what type of questions arrive in interview over c programming?
Explain what is the difference between a string and an array?
How can I change the size of the dynamically allocated array?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
What is pass by reference in functions?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
What should malloc() do?
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
What the advantages of using Unions?