• edited by
708 views
0 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

2 Answers

Best answer
2 2 votes

C) Compile time Error  

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

• selected by
Position:
Show:

Related questions

1 1 vote
1 1 answer
374
374 views
Depinder asked Jul 6, 2025
374 views
#include <stdio.h>struct Point { int x; int y;};int main() { struct Point p = {10, 20}; struct Point *ptr = &p; printf("%d %d", ptr->x, (*ptr).y); retur...
0 0 votes
2 2 answers
744
744 views
Sourin Kundu asked Jan 23, 2023
744 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 0 votes
2 answers 2 answers
805
805 views
Overflow04 asked Oct 2, 2022
805 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 1 vote
0 0 answers
1.5k
1.5k views
srestha asked Mar 6, 2019
1,532 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)?