Originally Posted by back from retirement
It's probably too late....yet I am posting my strcpy....
#define m 100
void my_strcpy(char a[m], char b[m])
char a[m], b[m];
printf("Enter your array\t");
printf("Copied string\t%s", b);
Please report for any inconvenience......cheers.....
@ r k @
hi i also need to solve this c++ question in my tutorial.
lets say instead i have to declare the my_strcopy before my int main(void) 's body. then i will declare my array as above in the main's body. after which i pass 2 arrays into my_strcopy to copy them.. after my mainbody, i would then define my function.
the question is... how do i declare the prototype before my main body?
i still have a question on fflush(stdin)
lets say i have
printf("enter a number\n");
printf("enter a name:\n");
printf("a is %d, name is %c\n",a,name);
what is the idea of fflush(stdin)? i know it is something related to inputbuffer and inputstream but i cant figure it out... and another thing to note.. how do i store a string of letters into "name"?