N
N
Nik_Haker2015-01-12 21:07:32
Programming
Nik_Haker, 2015-01-12 21:07:32

How can I jump to a certain position in a string in C++?

Given a variable of type string. For example, the user enters the number 3, and the text, and the program jumps to the third character in the text. For example: 3, text: fbvgd the program gave the result - c.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2015-01-12
@gbg

Check out the C++ Tutorial. Or a notebook with lectures.

const string str="asdf";
cout << str[3];  // выведет f, счет в строке с 0.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question