Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,22 @@
#include <stdio.h>
#include <stddef.h> /* for size_t */
#include <limits.h> /* for CHAR_BIT */
int main() {
int one = 1;
/*
* Best bet: size_t typically is exactly one word.
*/
printf("word size = %d bits\n", (int)(CHAR_BIT * sizeof(size_t)));
/*
* Check if the least significant bit is located
* in the lowest-address byte.
*/
if (*(char *)&one)
printf("little endian\n");
else
printf("big endian\n");
return 0;
}

View file

@ -0,0 +1,10 @@
#include <stdio.h>
#include <arpa/inet.h>
int main()
{
if (htonl(1) == 1)
printf("big endian\n");
else
printf("little endian\n");
}