Can one please spot my mistake, I know I've been a annoying user but the reason why I am because my knowledge of programming was zero till I started the course at my uni and I am doing much better than before for sure but more works needed for me.
#include
#include
char s1[80], s2[80];
int i;
int main (){
strcpy(s1, "cat");
i=0;
while(s1[i]!='\0'){
s2[i]=s1[i];
i++i
}
s2[i]=\0;
}

VulpesPosted Aug 13, 2012, 11:57 AM
printf(s2);
at the end so you need to add that line to check it's working properly
sami samPosted Aug 13, 2012, 10:35 AM
VulpesPosted Aug 13, 2012, 5:02 AM
sami samPosted Aug 13, 2012, 3:27 AM
d.c:13:2: warning: no newline at end of file
was not working too.
Nattudurai EswaramurthyPosted Aug 13, 2012, 3:06 AM
Could you please try the below code:
#include
#include
char s1[80], s2[80];
int i;
int main (){
strcpy(s1, "cat");
i=0;
while(s1[i]!='\0'){
s2[i]=s1[i];
++i;
}
s2[i]='\0';
}