summaryrefslogtreecommitdiff
path: root/md/notes
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2022-08-05 14:30:50 +0100
committerFreeArtMan <dos21h@gmail.com>2022-08-05 14:30:50 +0100
commita7444c2bf041aa620f9242cd9c3bbcc6955a19df (patch)
treeb604b3500c997948bef5c75a46bfc8582f4cd9f2 /md/notes
parent4929d091e0682a9965427369c2f64f01d0fdd606 (diff)
downloadmd-content-a7444c2bf041aa620f9242cd9c3bbcc6955a19df.tar.gz
md-content-a7444c2bf041aa620f9242cd9c3bbcc6955a19df.zip
Updated undefined c notes
Diffstat (limited to 'md/notes')
-rw-r--r--md/notes/undefined_c/titles.md63
1 files changed, 63 insertions, 0 deletions
diff --git a/md/notes/undefined_c/titles.md b/md/notes/undefined_c/titles.md
index e3e015d..11d5271 100644
--- a/md/notes/undefined_c/titles.md
+++ b/md/notes/undefined_c/titles.md
@@ -3,22 +3,82 @@ keywords:c,linux,asm
# Undefined C
+There is possible to piece of code inside online c compiler like https://www.onlinegdb.com/online_c_compiler
+Or run locally
+
## Syntax
### Variables
+
+Standard list of available types
+
+#### Check type size
+
+All types have size that are declared in bytes. Some of the types are machine dependents.
+like int/long, if there is needed machine independent types then there are int32_t/uint32_t/int64_t/uint64_t
+
+Each architecture 8bit/16bit/32bit/64bit will have different size for those types
+
+Use __sizeof()__
+
+Running on x86 machine
+```c
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdio.h>
+int main() {
+ printf("Sizeof int %lu\n",sizeof(int));
+ printf("Sizeof int32_t %lu\n",sizeof(int32_t));
+ printf("Sizeof int64_t %lu\n",sizeof(int64_t));
+ printf("Sizeof long %lu\n",sizeof(long));
+ printf("Sizeof long long %lu\n",sizeof(long long));
+}
+```
+
+Defined macros'es to get type max and min values are
+
+https://en.cppreference.com/w/c/types/limits
+
+```c
+#include <limits.h>
+int main() {
+ printf("INT_MIN %d\n",INT_MIN);
+ printf("INT_MAX %d\n", INT_MAX);
+ printf("LONG_MIN %ld\n",LONG_MIN);
+}
+```
+
+#### How to shoot the leg
+
+When code suppose to run on 32bit and 64bit platform the size of type may vary. n
+Need to take in account this case.
+
+
+
+
+
### Functions
+
+
+
### If statement
### For cycle
### Structure
### Recursion
### Macro
+### Signed/Unsigned
+### Endianess
### Styles
+### Compiler flags
## Base usage
### Kernel module
### Write plugins
+
+### Intermediate usage
+
## Linking
### Creating shared library
### Create static libraries
@@ -41,6 +101,9 @@ keywords:c,linux,asm
### Cross compile
### Different flags
### Check architecture
+### ARMv8
+### AVR8
+
## Graphics