Char character positions.

closed account (G854izwU)
Hey guys! If I have a char variable and I want to find what letter is in spot 3 how would I do it?

 
char achar = "abjhlsjdo"


I want to see whats in spot 3 so in this case it would be j. Is there any way to do that?

Thanks

-TheNewKid-
char achar = "abjhlsjdo" has a error, correct it like this:
char achar[] = "abjhlsjdo" (It's a array)
And you would get it like this:
achar[3-1] or... achar[2]
Because:
1
2
3
First character = 0
Second character = 1
Third character = 2

And hello, you again, lol
Last edited on
closed account (G854izwU)
Hello again haha! Also this is for the same project almost done!
I bet you didn't understand what i tried to explain you, Lol.
Oh, well, i didn't tell you about that specific thing.
Topic archived. No new replies allowed.