Please help me . I am new at C , Learing C will take time but i have to submit this and i dont know how to do it honestly so please help anyone .
thanks in advance .I will understand each line of code so as to understand ANSI C well.
______________________________________________
Write a function with the following prototype
Char *mystrcat(char *s, char *p);
The function appends string p to the end of string s and returns a pointer to the start of string s.
Remember that strings are terminated by binary zero (‘\0’).
Suppose string s contains “abcd” and string p contains “xyz”. The result would be string s containing “abcdxyz”.
Use the program section below to test your program:
#include <ctype.h>
char *mystrcat(char *s,char *p);
main()
{
Char string1[80], string2[80];
For ( ; ; )
{
Printf(“Enter string1: “);
Scanf(“%s”, &string1);
If (!strcmp(string1, “done”))
Break;
Printf(“Enter string2: “);
Scanf(“%s”, &string2);
Printf(“String1: %s String2: %s\n”, string1, string2);
Printf(“Returned string : %s\n”, mystrcat(string1,
string2);
Printf(“String1: %s String2: %s\n”, string1, string2);
}
}
Hint : ctestchar = *(ptrstring++) – assigns the character pointer to by ptrstring to the character ctestchar and moves the pointer on by one character
--------------------------------------------------------------------------------