あと、こちらの問題とは関係ないんですが、
コンマ区切りの文字列を分割するには、どうすればいいのでしょうか?
とりあえず自分で調べた範囲ではこんなに長くなりました。
Perlでの @array = split( /,/, $line ) みたいな単純な方法ありますか?

void main( void )
{
 string str, temp;
 int left, right;
 str = "hoge,moge,hage,giko,mona,fusa,zpnu";
 cout << str << endl;

 left = str.find_first_not_of( "," );
 while ( left != string::npos ) {
  right = str.find_first_of( ",", left );
  if ( right == string::npos ) {
   right = str.length();
  }
  temp = str.substr( left, right - left );
  cout << temp << endl;
  left = str.find_first_not_of( ",", right );
 }
}