Bcoz, the char itself returns the address...
so no need for using '&' before it...
2006-11-27 21:41:13
·
answer #1
·
answered by Vaibhav 4
·
0⤊
0⤋
Yes buddy,
take the below eg.
int number;
char name[10];
when ever you specify the name of a integer variable, i.e number, you are indicating just the content of the variable. If you get a input for that variable, you have to store that input in the memory location. so when put & before the variable name, ie. &number, now you are indicating the memory location of that integer, where you are going to store the input.
But in the case of string, whenever you specify the name of the variable, you are directly indicating the base address of that string. i,e by giving just name with out &, you specify the start address of the memory location from where you have store the input.
. . .
2006-11-30 00:29:08
·
answer #2
·
answered by V@su Maniram 3
·
0⤊
0⤋
yeah! we don't use scanf ,instead we use 'gets' & for printing a string we use 'puts'. this is b'coz scanf won't take spaces in between words,but using gets would avoid this problem.
2006-11-28 05:26:00
·
answer #3
·
answered by sweety 2
·
0⤊
0⤋