+ 1
Why adress operator absent in string of fetching a scanf statement for example ("%s",s)
If space is there then scanf stops reading for example:Hello World then output is Hello (any one tell how to overcome this )rather than get statement
4 Answers
+ 10
String is an array of characters literals, and array name itself denote the base address of the array. In string the pointer variables itself point towards the base address of the string so address of operator is not required. String in general hold the address of the character buffer which is pointed by pointer at the base address of the character array
+ 5
scanf is used to read input until it encounters a whitespace, newline or End Of File (EOF).
"&" is used to get the address of the variable. C does not have a string type, string is just an array of characters and an array variable stores the address of first index location.
by default the variable points to the base address and therefore to access base address of string there is no need to add an extra "&".
+ 1
Tnx for information now my doubt cleared
+ 1
Nice way u explained