随笔 - 29  文章 - 13  trackbacks - 0
<2006年9月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(1)

随笔分类

随笔档案

文章分类

文章档案

相册

收藏夹

c++

Linux

Tools

搜索

  •  

最新评论

阅读排行榜

评论排行榜

/*
exception handler

*/
   class El;
   class E2;


   void f() throw(E1, std::bad_exception)
                          //throws exception of type El or
                          //bad_exception for any other exception type
   {
      ...
      throw El();         //throws exception of type El
      ...
      throw E2();         //calls unexpected(), which throws bad_exception
   }
       

/*
numeric limits
*/

      cout << "max(short): " << numeric_limits<short>::max() << endl;
      cout << "max(int): " << numeric_limits<int>::max() << endl;
      cout << "max(long): " << numeric_limits<long>::max() << endl;


/*
container
*/
1.bmp

/*
algorithm

*/


#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

void print(int num)
{
    cout<<num<<endl;
}
int main()
{
    vector<int> list(20);
    generate(list.begin(),list.end(),rand);
    for_each(list.begin(),list.end(),print);
    cout<<" finish . press <<enter>> to exit "<<endl;
    cin.get();
}

posted on 2006-07-19 13:14 四海 阅读(157) 评论(0)  编辑 收藏 引用

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