Originally Posted by
eXeCuTeR
So why do I need to put str in p? what different does it make whether the string/w/e is on str or p?
You answered it yesterday I guess, but I forgot ^^
hmm..
sometimes if you want to change the string you dont have to go to every point and change it..
if you have something like this
Code:
main()
{
char str[]="I am string1";
printf("%s\n",str);
//now lets play with string in some function
strcpy(str,"I am string2");
printf("%s\n",str);
}
/**************************************************************
else the basic way will be
str[0]= 'I';
str[1]=' ';
str[2]='a';
str[3]='m';
...
str[13]='2';
all these lines of code can be done in one single call strcpy(str,"I am string2")
***************************************************************/