& pass es the starting address of the string in memory to the function. C is built on the RAM-Model (Random access machine). So you pass the address of the memory segment. the type defines the size of memory used.
so a char is usually 1 Byte long (not utf8) so what you say is:
hey reserve 20 bytes for me and register the starting address to that memory with my variable name;
scan for input from the user and put the characters type starting at the ADDRESS i've given you.
that's why passing the value of it (no &) does not work. you want the program to write at the address / memory block reserved for your variable.
j
stuff ;)
& pass es the starting address of the string in memory to the function. C is built on the RAM-Model (Random access machine). So you pass the address of the memory segment. the type defines the size of memory used.
so a char is usually 1 Byte long (not utf8) so what you say is:
that's why passing the value of it (no &) does not work. you want the program to write at the address / memory block reserved for your variable.
C and pointers gg have fun ^^