hey all: i am in my second semester of c++ programming, and that is the extent of my experience with it. im looking for some help:
i cant figure out how to find the substring by modifying the following code:
char *mysubstr(char *substr, const char *src, int first, int length){
// returns substring of src starting at position "first" and having the size "length"
char *rez = substr;
char *srcstart = first;
if (((first < 0) || (length < 1)) || (length > sizeof src))
{
substr = '\0';
}
else
{
for (;*src != '\0';src++);
for (; ;*substr = ;substr++)
}
return rez;
}
it's supposed to be what the library uses, so i cant use any library calls. i just need to complete the code.
int first = the location of the first letter of the substring on the source string
length = the length of the substring off of the first location
thanks alot. this is my first post here, so hello all!
Jesse