在C语言中,左值为寻找变量的地址,右值为寻找变量的值
有如下程序:
#include <stdio.h>
int main()
{
int i = 5;
int *p = &i;
scanf("%d",p);
printf("%d",*p);
}
Output:
8
8
p做右值输出p的值,即i的地址。
又有:
char *s = "kkk";
printf("%s",s);
output:<
在C语言中,左值为寻找变量的地址,右值为寻找变量的值
有如下程序:
#include <stdio.h>
int main()
{
int i = 5;
int *p = &i;
scanf("%d",p);
printf("%d",*p);
}
Output:
8
8
p做右值输出p的值,即i的地址。
又有:
char *s = "kkk";
printf("%s",s);
output:<