first commit

This commit is contained in:
Jose Caban
2025-06-07 11:38:03 -04:00
commit e0316ca3ff
79 changed files with 3155 additions and 0 deletions

24
Endian/C/endian.c Normal file
View File

@@ -0,0 +1,24 @@
#include <stdio.h>
void show_memory(const char* begin, size_t length)
{
size_t i = 0;
for (; i < length; i++)
{
printf(" %.2x", 0xff & begin[i]); // 0xff is necessary due to type promotion
}
printf("\n");
}
int main(int argc, char** argv)
{
(void)argc;
(void)argv;
float f = 42654.2312f;
int i = 7753238;
printf("Printing float %f with size %ld\n", f, sizeof(f));
show_memory((char*)&f, sizeof(f));
printf("Printing int %d with size %ld\n", i, sizeof(f));
show_memory((char*)&i, sizeof(i));
return 0;
}