There are multiple ways to create a string in C:
char* string1 = "hi"; char string2[] = "world"; printf("%s %s", string1, string2)I have a lot of problems with this:
According to my understanding of [[Pointers]], string1 is a pointer and we're passing it to [[printf]] which expects actual values not references.
if we accept the fact that printf expects a pointer, than how does it handle string2 (not a pointer) just fine
I understand that char* is designed to point to the first character of a string which means it effectively points to the entire string, but what if I actually wanted to point to a single character
this doesn't work, because we are assigning a value to a pointer:
int* a; a = 8so why does this work:
char* str; str = "hi"[link] [comments]

![[PROJECT] fread: TUI Text-File Reader written in C to view text files on your terminal](https://browardlocals.com/hello.gif)






English (US) ·