好的所以我正在为课程编写代码,我认为一切都是正确的,除非我在printf语句中遇到错误我不知道如何做c代码而我的老师让我们自学.我收到一个未声明的标识符错误以及printf语句中的非ASCII字符错误有人可以帮我弄清楚为什么我会收到这些错误?我只是希望他们逐字逐句地打印出那个陈述,那么为什么它会把它看成不同的东西呢?
#include <inttypes.h>
#include <stdio.h>
typedef enum{false, true} bool;
bool is_little_endian()
{
int x = 1;
char *y = (char*)&x;
return 1;
}
unsigned int merge_bytes( unsigned int x, unsigned int y )
{
return (y & 0xffffff00) | (x & 0xff);
}
unsigned int replace_byte (unsigned int x, int i, unsigned char b)
{
int shift = (b << (8 * i));
int mask = 0xff << shift;
return (~mask & x) | shift;
}
int main()
{
if( …Run Code Online (Sandbox Code Playgroud) c ×1