Hello, i need some help, I've tried to do a bit of the function but i cant get it to return the first n characters. The variables have stay the same and nothing can be changed. All i have to do is complete the function. Can someone help me please? What i've already done is kinda wrong because it only copies string1 into string2.
Thanks alot. BELISAR !
This is the function: void strhead(char * string1, char * string2, int n)
{
/* copies the first n characters of string1
to string2
*/
int i=0;
for(i=0; string1 != '\0'; i++)
{
if
string2 = string1;
}
}
case 7 : testing("strhead");
printf("Input a string? ");
getString(stringA,255);
printf("Take how many? ");
n=getInt();
strhead(stringA,stringB,n);
printf(" First %d of '%s' is '%s'\n",n,stringA,stringB);
if (testno != 1) break;