this code is correct else correct me
Code:char p[1]; scanf("%s",&p[1]); prtintf("%s",&p[]);
this code is correct else correct me
Code:char p[1]; scanf("%s",&p[1]); prtintf("%s",&p[]);
Very much NOT correct.
Fine but pointlessCode:char p[1];
You are trying to read in a null terminated string and put it into a ONE character. Even worse your index on the array is wrong. it should be [0].Code:scanf("%s",&p[1]);
Should be printf() and you are trying to print a null terminated string giving it one character. However even that is incorrect since you didn't give an index to use.Code:prtintf("%s",&p[]);
you need room in your arrays because all they are are strings characters pointing to the next one then a '\0' at the end
so say you doCode:char array[]="Strings";so your code creates room for one character a '\0' character and that is it. Do you understandCode:array[0]='S'; array[1]='t'; array[2]='r'; array[3]='i'; array[4]='n'; array[5]='g'; array[6]='s'; array[7]='\0';
hehe
p[0]=your first num
p[1]=the second ......I only can answer u so much!(我仅能回答你这些)!
thank you all my code it's o.k now