I've been giving an... interesting... task. I've been asked to modify a character array using a pointer.
I'm aware that:
*char = "something"; //is a literal and cannot be modified.
char[] = "something"; //can be modified
But what about:
main.c
------
static char* stringlist01[] = 
{
    "thiy iy a ytring",
    "this is also a string, unlike the first string",
    "another one, not a great one, and not really like the last two.",
    "a third string!",
    NULL,
};
int main()
{
    int ret = 9999;
    printf("////TEST ONE////\n\n");
    ret = changeLetterInString(stringlist01[0]);
    printf("Return is: %d\n\n", ret);
    printf("Stringlist01[0] is now: %s\n", stringlist01[0]);
}
AND
changeLetterInString.c
----------------------
int changeLetterInString(char *sentence)
{    
    if (sentence != NULL)
    {
        // TODO
        // Need to change "thiy iy a ytring"
        // into "this is a string"
        // and save into same location so
        // main.c can see it.
    }
    success = 0;    // 0 is Good
    return success;
}
So far, I've tried:
    for (char* p = sentence; *p; ++p)
    {
        if (*p == 'y')
        {
            *p = 's';
        }
    }
And I've tried:
sentence[0] = 't'
sentence[1] = 'h'
sentence[2] = 'i'
sentence[3] = 's'   // and so on...
But neither work.
Any help and/or insight would be greatly appreciated.
 
    