Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question