I have a string,
char* str = "HELLO"
If I wanted to get just the E from that how would I do that?
E
char* str = "HELLO"; char c = str[1];
Keep in mind that arrays and strings in C begin indexing at 0 rather than 1, so "H" is str[0], "E" is str[1], the first "L" is str[2] and so on.
str[0]
str[1]
str[2]
1.4m articles
1.4m replys
5 comments
57.0k users