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
why programs in c are running with out #include
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What is 1f in c?
Which is better between malloc and calloc?
What is difference between main and void main?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
Explain what is the difference between #include and #include 'file' ?
What is string length in c?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
program for reversing a selected line word by word when multiple lines are given without using strrev
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
What is FIFO?
How can I find out how much free space is available on disk?
What is #include called?
What is the benefit of using const for declaring constants?