【发布时间】:2014-05-16 04:38:51
【问题描述】:
#include <stdio.h>
#include <string.h>
typedef unsigned int uint32;
typedef unsigned char uint8;
int main()
{
double a = 1320.134;
uint32 b;
uint8 c[20];
b = (unsigned int)a;
c[3] = b; //c[3] = (unsigned char)b;
printf("value of %c", c[3]);
return 1;
}
我正在尝试在我的程序中进行一些类型转换。在主要功能内部 - 1:我正在转换并将其存储在双精度中。 2:我想将 uint32 值存储在第三个位置的字符数组中,但如果我按照上面的操作,我无法获得输出。请有人帮我解决这个问题??
输出:c
【问题讨论】:
标签: c arrays pointers type-conversion unsigned