diff --git a/.zed/tasks.json b/.zed/tasks.json index 9f717ab..8889305 100644 --- a/.zed/tasks.json +++ b/.zed/tasks.json @@ -4,7 +4,7 @@ [ { "label": "Build Current File", - "command": "gcc -Wall -Wextra -g -std=c11 -O2 $ZED_FILENAME -o ./output/$ZED_STEM.exe", + "command": "$rand = -join ((97..122) | Get-Random -Count 6 | % {[char]$_}); $outputFile = \"./output/${ZED_STEM}_$rand.exe\"; gcc -Wall -Wextra -g -std=c11 -O2 $ZED_FILE -o $outputFile", //"args": [], // Env overrides for the command, will be appended to the terminal's environment from the settings. "env": {}, @@ -53,7 +53,7 @@ }, { "label": "Build & Run Current File", - "command": "gcc $ZED_FILENAME -o ./output/$ZED_STEM.exe ; if ($?) { ./output/$ZED_STEM.exe }", + "command": "$rand = -join ((97..122) | Get-Random -Count 6 | % {[char]$_}); $outputFile = \"./output/${ZED_STEM}_$rand.exe\"; gcc -Wall -Wextra -g -std=c11 -O2 $ZED_FILE -o $outputFile; if ($?) { &$outputFile }", //"args": [], // Env overrides for the command, will be appended to the terminal's environment from the settings. "env": {}, diff --git a/02_11p.c b/02/02_11p.c similarity index 100% rename from 02_11p.c rename to 02/02_11p.c diff --git a/02_13p.c b/02/02_13p.c similarity index 100% rename from 02_13p.c rename to 02/02_13p.c diff --git a/02/02_14p_1.c b/02/02_14p_1.c new file mode 100644 index 0000000..d271e0d --- /dev/null +++ b/02/02_14p_1.c @@ -0,0 +1,13 @@ +#include + +int main() { + int a; + a = 10; + int b; + b = 20; + + printf("a : %d\n", a); + printf("b : %d\n", b); + + return 0; +} diff --git a/02/02_14p_2.c b/02/02_14p_2.c new file mode 100644 index 0000000..fb629bc --- /dev/null +++ b/02/02_14p_2.c @@ -0,0 +1,8 @@ +#include + +int main() { + int A; + printf("%d", a); + + return 0; +} diff --git a/02/02_14p_3.c b/02/02_14p_3.c new file mode 100644 index 0000000..ccf25c9 --- /dev/null +++ b/02/02_14p_3.c @@ -0,0 +1,6 @@ +#include + +int main() { + int a, int b, int c; + return 0; +} diff --git a/02/02_14p_4.c b/02/02_14p_4.c new file mode 100644 index 0000000..a854ce0 --- /dev/null +++ b/02/02_14p_4.c @@ -0,0 +1,7 @@ +#include + +int main() { + int if; + + return 0; +} diff --git a/02/02_24.c b/02/02_24.c new file mode 100644 index 0000000..583221f --- /dev/null +++ b/02/02_24.c @@ -0,0 +1,8 @@ +#include +#define TMP 20 + +int main() { + printf("TMP: %d\n", TMP); + // TMP = 10; + return 0; +} diff --git a/02/02_25.c b/02/02_25.c new file mode 100644 index 0000000..efe2e1d --- /dev/null +++ b/02/02_25.c @@ -0,0 +1,11 @@ +#include + +int main() { + int const a = 100; + const int b = 200; + + printf("a: %d\n", a); + printf("b: %d\n", b); + + return 0; +} diff --git a/02/02_33p.c b/02/02_33p.c new file mode 100644 index 0000000..2d5c8d8 --- /dev/null +++ b/02/02_33p.c @@ -0,0 +1,21 @@ +#include + +int main() { + printf("int: %zu bytes\n", sizeof(int)); + printf("short: %zu bytes\n", sizeof(short)); + printf("long: %zu bytes\n", sizeof(long)); + printf("long long: %zu bytes\n", sizeof(long long)); + + printf("float: %zu bytes\n", sizeof(float)); + printf("double: %zu bytes\n", sizeof(double)); + printf("long double: %zu bytes\n", sizeof(long double)); + + printf("char: %zu bytes\n", sizeof(char)); + + char ch = 'A'; + printf("\n%c %d", ch, ch); + ch += 32; + printf("\n%c %d", ch, ch); + + return 0; +} diff --git a/02/02_38p.c b/02/02_38p.c new file mode 100644 index 0000000..1fe968a --- /dev/null +++ b/02/02_38p.c @@ -0,0 +1,8 @@ +#include +#include + +int main() { + printf("%f", sqrt(2)); + + return 0; +} diff --git a/init.ps1 b/init.ps1 new file mode 100644 index 0000000..86b9ef7 --- /dev/null +++ b/init.ps1 @@ -0,0 +1,5 @@ +$env:Path += ';C:\mingw64\bin' + +winget source update +winget install waterfox.waterfox --source winget +winget install ZedIndustries.Zed --source winget