summaryrefslogtreecommitdiffstats
path: root/tests/tst_sizeof.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tst_sizeof.c')
-rwxr-xr-xtests/tst_sizeof.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/tst_sizeof.c b/tests/tst_sizeof.c
new file mode 100755
index 0000000..46ce2cf
--- /dev/null
+++ b/tests/tst_sizeof.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+char str[]={'A',};
+int i[]={1,2,3};
+
+struct tsr
+{
+int len;
+char s[256];
+} t = {sizeof(str),"string"};
+
+int main()
+{
+printf("sizeof str: %u i:%u\n",sizeof("string"),sizeof(i));
+return 0;
+}