vector<string> getHtmlTags() {
vector<string> tags;
while (cin) {
string line;
getline (cin,line);
int pos = 0;
int ts = line.find("<",pos);
while (ts!=string::npos) {
int te = line.find(">", ts+1);
tags.push_back(line.substr(ts,te-ts+1));
pos = te + 1;
ts = line.find("<",pos);
}
}
return tags;
}
여기서 밑줄 그은 부분들 때문에 문제가 되는 중이야
find는 값이 size_t 타입 변수여야 하는데 책에서는 int 로 나와있더라고
근데 size_t로 바꾸면 굵은 글씨 부분 (pos = te + 1) 이 계산이 안돼
이걸 해결할 수 있는 방법 있을까?
캐스팅해주세용 - 164260의 휘발성 계정
그리고 이런건 정규표현식을 쓰는게 어떨가요 - 164260의 휘발성 계정