⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 prog11_03.cpp

📁 c++最经典的入门书籍
💻 CPP
字号:
// Program 11.3 Working with a Person    File: prog11_03.cpp
#include <iostream>
#include "person.h"
using std::cout;
using std::endl;

int main() {
  Person her = {
                 { "Letitia", "Gruntfuttock" },     // Initializes Name member
                 {1, 4, 1965                 },     // Initializes Date member
                 {212, 5551234               }      // Initializes Phone member
               };

  Person actress;
  actress = her;                                   // Copy members of her
  her.show();
  Date today = { 15, 6, 2003 };

  cout << endl << "Today is ";
  today.show();
  cout <<  endl; 

  cout << "Today " << actress.name.firstname << " is " 
       << actress.age(today) << " years old."
       << endl;
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -