add sizeof.c

This commit is contained in:
zibright 2025-04-28 16:58:56 +08:00
parent 165a3cd686
commit 6e8729df55
6 changed files with 32 additions and 0 deletions

BIN
Code/hello Normal file

Binary file not shown.

7
Code/hello.c Normal file
View File

@ -0,0 +1,7 @@
#include <stdio.h>
int main()
{
printf("hello world\n");
return 0;
}

BIN
Code/sizeof Normal file

Binary file not shown.

17
Code/sizeof.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdbool.h>
int main()
{
printf("int: %ld\n",sizeof(int));
printf("float: %ld\n",sizeof(float));
printf("double: %ld\n",sizeof(double));
printf("char: %ld\n",sizeof(char));
printf("long: %ld\n",sizeof(long));
printf("long long: %ld\n",sizeof(long long));
printf("short: %ld\n",sizeof(short));
printf("void: %ld\n",sizeof(void));
printf("bool: %ld\n",sizeof(bool));
printf("unsigned int: %ld\n",sizeof(unsigned int));
return 0;
}

BIN
Code/test Normal file

Binary file not shown.

8
Code/test.c Normal file
View File

@ -0,0 +1,8 @@
#include<stdio.h>
int main()
{
printf("hello!");
return 0;
}