S
S
SpyceR2016-03-08 14:29:31
C++ / C#
SpyceR, 2016-03-08 14:29:31

How to display an element of a character array?

How to print an element of a character array using pointers, not indices?

char *s = "Test";
cout << s+1;

Outputs "est" and I just need "e".
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SpyceR, 2016-03-08
@SpyceR

Already decided by myself.
Need to use cout << *(s+2);
Thank you all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question