int strpartcopy(char* goal,char* source,int sTART,int eND){
if(sTART>eND)
return 0;
else{
int i=0;
for(;sTART<=eND;++sTART,++i)
goal[i]=source[sTART];
goal[i]='\0';
return 1;
}
}
I hoped to copy parts of a String with strpartcopy, for
example:
char arr1[12]="BIG TROUBLE";
char arr2[6]="SO OLD";
strpartcopy(arr1, arr2, 3, 5) // Should lead to
// "OLD TROUBLE" in arr1... BUT:
cout << arr1; // only shows "OL" or "OLD" on the screen
/* What' s wrong? I hoped to get "OLD TROUBLE" */