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
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
int far *near * p; means
What is define c?
Do pointers take up memory?
Explain About fork()?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
What is the difference between void main and main in c?
What are the difference between a free-standing and a hosted environment?
Find MAXIMUM of three distinct integers using a single C statement
Explain how many levels deep can include files be nested?
What is a shell structure examples?
What is the difference between int main and void main in c?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }