|
맨 아래에 있는 split function 을 인터넷에서 다운받아 사용할려고 했더니, 두개의 에러가 나는군요.
Err-1: E2209 Unable to open include file 'vcl.h' at line 3
Err-2: E2303 Type name expected at line 11
실지로 include 디렉토리를 듸져보니 vcl.h는 없더군요.
솔찍히 완전 초보라서 그것이 뭐에 쓰이는지 용도도 모르지만...쯥...
제 짐작으로는 이 vcl.h 란 헤더는 용도폐기 되었거나 (다른 헤더파일로 흡수??) 아니면
제가 사용하는 C++BuildeX (personal edit.)가 꽁짜로 쓰는것이라서 vcl.h가 없다든지...
고수님들의 도움 부탁드립니다.
그것참....
이럴때 내 자신이 정말 바보같이 느껴지네요.
떡을 먹으라고 상자에 담아 주었더니, 상자를 열줄몰라 떡을 못먹는 안타까움.....
꾹 참고 계속 노력하면 언젠가 극복되겠죠 ㅎㅎ.ㅎ
다음은 제가 다운받아서 사용할려고 하는 코드입니다.
//---------------------------------------------------------------------------
#include <vcl.h>
#include <iomanip.h>
#include <iostream.h>
#include <string>
#pragma hdrstop
//---------------------------------------------------------------------------
string Split(string Str, Integer Slot,char chr)
{
int dummyInt = 0;
int begin = 0;
int end = 0;
const int strLength = Str.length() - 1;
for(int x = 0; x <= strLength; x++){
if(Str[x] == chr)
++dummyInt;
if(dummyInt == Slot){
begin = x + 1;
for(int y = begin; y <= strLength; y++){
++end;
if(Str[y] == chr && Slot == 0)
return Str.substr(begin - 1,end);
if(Str[y] == chr){
return Str.substr(begin,end - 1);
}
}
return Str.substr(begin,strLength);
}
}
return "{String Error}";
}
#pragma argsused
int main(int argc, char* argv[])
{
string blah = "Hello!World!c++";
string newStr;
newStr = Split(blah,2,'!');
cout<<newStr<<endl;
system("pause");
return 0;
}
//---------------------------------------------------------------------------
|