diff --git a/c_modern_approach/Strings/playground.c b/c_modern_approach/Strings/playground.c new file mode 100644 index 0000000..dd11763 --- /dev/null +++ b/c_modern_approach/Strings/playground.c @@ -0,0 +1,15 @@ +#include +int main(void) { + // String literal assigment + char *p; + /*Following statement does not copy string. It makes pointer p to point to first charachter of list of chars*/ + p = "abc"; + printf("%s\n\n", p); + + // --- + + // Subscripting + char ch; + ch = p[1]; + printf("%c\n", ch); +}