From 26278d985fbafd988cca75e0a0b2fb2ef8b044dc Mon Sep 17 00:00:00 2001 From: sirlilpanda Date: Mon, 13 Apr 2026 00:42:59 +1200 Subject: [PATCH] added string literals --- src/content/blog/c-fun.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/content/blog/c-fun.md b/src/content/blog/c-fun.md index e46cfeb..a6acc6d 100644 --- a/src/content/blog/c-fun.md +++ b/src/content/blog/c-fun.md @@ -478,6 +478,20 @@ void f(const char *str) { ``` +## string literals +string literals dont have to be assigned to anything to be included this can be useful if you want version numbers directly in the program without exposing them to the user. +notes that this will throw a warn and some compliers might remove it all togeather. + +```c + +void main() { + "hello world"; +} + +``` + + + ## extra reading and where i got these things from - Programming in Modern C with a Sneak Peek into C23 : https://www.youtube.com/watch?v=lLv1s7rKeCM