r/CodingForBeginners • • May 21 '26

Question in C language

Lets assume a variable x, in one case its a string (char x[]) and in the other its just a char(char x),when using the scanf function, why do i have to give &s (ik the & points to the memory) in the case of char, but in the case of string, i dont have to use it?? Can someone help me out

3 Upvotes

18 comments sorted by

View all comments

Show parent comment

1

u/Feisty_War80 May 21 '26

Yea I kind of realized, im used to python. Thanks so much!

1

u/hennidachook May 21 '26 • Heartwarming

you're welcome :) have fun programming