#include<stdio.h>
#include <stdarg.h>
#include <iostream>
using namespace std;

int main(void)
{
	string str("babccbabcaabcccbabccabcabcabbabcc");
	int num = 0;
	size_t fi = str.find("abc", 0);    
	while (fi!=str.npos) //如果没找到,返回一个特别的标志c++中用npos表示,我这里npos取值是4294967295,  
	{
		cout << fi << "   ";
		num++;
		fi = str.find("abc", fi + 1);
	}
	if (0 == num)
		cout << "not find!";
	cout << endl;

	//实际应用,用来判断内网,外网
	/*
	size_t fi = m_ToDBSrvConfig.IP.find("192.168");
	if(fi  == string.npos)
	{
		m_bOpenDebugLog = false;
	}
	*/
	getchar();
	return 0;
}