How there is Lvalue required error
There is a piece of code which is producing error of "Lvalue required".
The code is as,
#include<stdio.h>
#include<conio.h>
#define max 10
int main()
{
printf("%d",max++);
return 0;
}
It was evident that Lvalue error will come in above code so i changed the
code to
int a;
printf("%d",a=max++);
I thought now the value of constant is assigned to a proper variable but
still the error appeared. Then i checked for
printf("%d",a=max+1);
it works without any error.What is the problem with the second piece of
code ?
No comments:
Post a Comment