C
crystal twix
For an assignment, I am trying to write a string function that returns
a portion of the string. My parameter list is a const char word[],
int start, int end, char result[].
Being new to arrays and pointers, I'm not sure what is the way I want
to handle the const char word[] without getting compiler warnings of
"Assignment qualifier discards qualifiers from pointer target type. I
thought I could create a pointer named temp
int *temp = word;
and get the string by using the start and end parameters by
incrementing the pointer through the array and returning result. But
I'm kind of stuck on where to start. Thanks.
a portion of the string. My parameter list is a const char word[],
int start, int end, char result[].
Being new to arrays and pointers, I'm not sure what is the way I want
to handle the const char word[] without getting compiler warnings of
"Assignment qualifier discards qualifiers from pointer target type. I
thought I could create a pointer named temp
int *temp = word;
and get the string by using the start and end parameters by
incrementing the pointer through the array and returning result. But
I'm kind of stuck on where to start. Thanks.