#include<stdio.h>
#include<string.h>
int main()
{
char source[]="Sayonara";
char target[8];
strcpy(target,source);
printf("source string= %s\n",source);
printf("target string= %s\n",target);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
输出: - 源字符串=
目标字符串= Sayonara
# define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( "%d %d %d", i, j, temp);
}
Run Code Online (Sandbox Code Playgroud)
执行上面的代码后,我得到意想不到的输出,我没有得到这背后的确切逻辑.所以请帮帮我.
上述代码的输出:
10 0 0
Run Code Online (Sandbox Code Playgroud) c ×2