Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4245608
  • 博文数量: 1148
  • 博客积分: 25453
  • 博客等级: 上将
  • 技术积分: 11949
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-06 21:14
文章分类

全部博文(1148)

文章存档

2012年(15)

2011年(1078)

2010年(58)

分类: C/C++

2011-09-18 11:24:14

pair类型

  1. #include <iostream>
  2. #include <utility>

  3. using std::cout;
  4. using std::endl;
  5. using std::string;
  6. using std::pair;

  7. int main(void)
  8. {
  9. // pairproust("james","joyce");
  10.         // using typedef defintion
  11.         typedef pair Author;
  12.         Author proust("james","joyce");

  13.         cout << proust.first << endl;
  14.         cout << proust.second << endl;
  15.         return 0;
  16. }
  1. ywx@ywx:~/Desktop/yu$ ./pair
  2. james
  3. joyce

阅读(1081) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~