Skip to content

[HELP] problem about endianness #207

@kakaducsy

Description

@kakaducsy

source:

#include <cstdio>
int main()
{
    char arr = 0x11;
    printf("c=%c\n", arr);
    return 0;
} 

Insight:

 #include <cstdio>
int main()
{
  char arr = 17;
  printf("c=%c\n", static_cast<int>(arr));
  return 0;
}

my understand that, the output of code above in Little endian machine and Big endian machine not the same, Is it correct?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions