小编Sud*_*Roy的帖子

我无法理解这个c编程的输出.请任何一个帮助

#include <stdio.h>

int main () {
    int x, y, z;

    x = y = z = 1;
    ++x || ++y && ++z;
    printf ("x = %d\t y = %d\tz = %d\n", x, y, z);
    //op  :   x = 2    y = 1  z = 1 
    //why is 'x' only incrementd? 

    x = y = z = -1;
    ++x || ++y && ++z;
    printf ("x = %d\t y = %d\tz = %d\n", x, y, z);
    //op  :  x = 0    y …
Run Code Online (Sandbox Code Playgroud)

c

4
推荐指数
2
解决办法
143
查看次数

C:如何将双数(例如123.45)存储在浮点变量或双变量或长双变量中?

#include <stdio.h>

int main () {
float a = 123.0; 

unsigned char ch, *cp;
ch = 0xff;

cp = (unsigned char *) &a;
printf ("%02x", ch&(*(cp+3)));
printf ("%02x", ch&(*(cp+2)));
printf ("%02x", ch&(*(cp+1)));
printf ("%02x\n", ch&(*(cp+0)));

/*I have written this program to see binary representation, but I can not understand the output, the binary representation?
}
Run Code Online (Sandbox Code Playgroud)

c

3
推荐指数
1
解决办法
1万
查看次数

标签 统计

c ×2