Strings In Depth5 / 18
Up next

char* vs char[]

#include <stdio.h>

int main(void) {
    const char *view = "hello";
    char owned[] = "hello";
    owned[0] = 'H';
    printf("%s %s\n", view, owned);
    return 0;
}
What you're solving

a literal is read-only, an array is a copy