#include
main()
{
int *p, *c, i;
i = 5;
p = (int*) (malloc(sizeof(i)));
printf("
%d",*p);
*p = 10;
printf("
%d %d",i,*p);
c = (int*) calloc(2);
printf("
%d
",*c);
}
Answer / Nagender Choudhary
These lines of code dynamically allocate memory for an integer variable using malloc() and calloc(). The * operator is used to dereference the pointer, allowing it to be assigned a value. The fclose() function is used to close the file pointer.
| Is This Answer Correct ? | 0 Yes | 0 No |
why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above
LOGIC OF Bodmas?
Can main () be called recursively?
True or false: If you continuously increment a variable, it will become negative? 1) True 2) False 3) It depends on the variable type
main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(ā%dā,x); }
What is #include conio h?
4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none
An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above
How can I ensure that integer arithmetic doesnt overflow?
WHOT IS CHAR?
Here is a good puzzle: how do you write a program which produces its own source code as output?
why TCS selected more student in the software field from all institution.