#include "stdafx.h"
#include<string>
using namespace std;
int main()
{	string str="abcd";
	for(string::iterator it=str.begin();it!=str.end();it++) /*string和vector支持直接对迭
	代器进行加减数字,如Str.begin()+3 */
	{
		printf("%c",*it);
	}
		printf("\n");
	return 0;

}

迭代器访问string

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-08-20
  • 2022-02-21
  • 2021-03-31
  • 2021-07-23
猜你喜欢
  • 2021-08-08
  • 2022-12-23
  • 2021-05-10
  • 2021-06-17
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案