edited by
316 views
0 votes
0 votes
#include<stdio.h>
void foo(int*)
int main()
{
    int i=10;
    foo((&i)++);
}
void foo(int*p)
{
    printf(%d\n",*p);
}



A)10   B)Some garbage value  C) Compile time Error  D)Segmentation Fault/Code Crash

edited by

2 Answers

Best answer
2 votes
2 votes

C) Compile time Error  

Whenever we are trying to increment or decrement Constant Expression. L-value error will come

selected by

Related questions

0 votes
0 votes
2 answers
1
Sourin Kundu asked Jan 23, 2023
410 views
How many number of add and remove operations are required to access 26th element of a queue of 50 elements,so that the original queue remains the same after the access is...
0 votes
0 votes
2 answers
2
Overflow04 asked Oct 2, 2022
345 views
#include <stdio.h int main(){ int a[] = {5,3,7,2,4}; int *p = &a[3]; p -= *p; printf("%d ",*p); return 0; } output is 3.Why 2 * sizeof(int) is doene.?
1 votes
1 votes
0 answers
3
srestha asked Mar 6, 2019
779 views
void find(int x){ static int i=10,y=0; y=y+i; for(i;i>0;i=i-10){ if(x!=0) find(x-1); else{ printf("%d",y); } } }What will be output printed for find(4)?
0 votes
0 votes
1 answer
4