随笔 - 132  文章 - 51  trackbacks - 0
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用链接

留言簿(7)

随笔分类

随笔档案

文章分类

文章档案

cocos2d-x

OGRE

OPenGL

搜索

  •  

最新评论

阅读排行榜

评论排行榜

bool StringEqual( const char* p,
        const char* tag,
        bool ignoreCase
        /*TiXmlEncoding encoding */)
{
 assert( p );
 assert( tag );
 if ( !p || !*p )
 {
  assert( 0 );
  return false;
 }

 const char* q = p;

 if ( ignoreCase )
 {
  while ( *q && *tag && tolower( *q ) == tolower( *tag ) )
  {
   ++q;
   ++tag;
  }

  if ( *tag == 0 )
   return true;
 }
 else
 {
  while ( *q && *tag && *q == *tag )
  {
   ++q;
   ++tag;
  }

  if ( *tag == 0 )  // Have we found the end of the tag, and everything equal?
   return true;
 }
 return false;
}

2.读取文件

    string line; 
    ifstream input(
"input.txt",ios::in); 

    
while(1
    

        getline(input,line); 
        
if(input.eof()) break

    }
 
    input.close(); 

 

posted on 2011-12-14 08:11 风轻云淡 阅读(340) 评论(0)  编辑 收藏 引用 所属分类: C++

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理