For example, in python, you can index strings like this
some_string = "hello"
substring = some_string[0:3]
and substring will be "hel"
however, in C, if I have
char some_string[] = {'h', 'e', 'l', 'l', 'o'};
Is there a way to get just
{'h', 'e', 'l'}
There is probably a very simple solution that I am overlooking, but I find it hard to think in two languages sometimes.
some_stringis not a C string. It lacks the null-terminator.