-6
を理解する上で私を助ける:C、このコードが印刷されます。このASCIIのPROB
S = 1、I = 65537、= 65537.000000、C = 1
fが、私はなぜ理解する上で助けを必要とそれはc = 1を印刷していますか?出力へ
#include <stdio.h> // Standard input-output library
#include <stdlib.h> // Standard general utilities library
int main(void) {
int i = 65537;
unsigned short s = (unsigned short)i;
float f = (float)i;
char c = (char)i;
printf("s = %u, i = %d, f = %f, c = %d\n", s,i,f,c);
system("PAUSE");
return (0);
}
を持つことになります。あなたは '%d'ではなく'%c'で 'char'sを表示します。 – StoryTeller
@StoryTeller数値を見たい場合はありません。 – aschepler
同じ理由でc = 1 s = 1 – Stefan