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

📄 inline.cpp

📁 不错书对C++/C程序员很有用的大家不要错过.
💻 CPP
字号:
#include <iostream.h>
#include <string.h>

class movie 
{
public:
  char name[64];
  char first_star[64];
  char second_star[64]; 
  void show_movie(void)
    {
      cout << "Movie name: " << name << endl;
      cout << "Starring: " << first_star << " and " << second_star << endl << endl;
    }
  
  void initialize(char *movie_name, char *first, char *second)
    {
      strcpy(name, movie_name);
      strcpy(first_star, first);
      strcpy(second_star, second);
    }
};

void main(void)
 {
   movie fugitive, sleepless;

   fugitive.initialize("The Fugitive", "Harrison Ford", "Tommy Lee Jones");
   sleepless.initialize("Sleepless in Seattle", "Tom Hanks", "Meg Ryan");

   cout << "The last two movies I've watched are: " << fugitive.name << " and " << sleepless.name << endl;

   cout << "I thought " << fugitive.first_star << " was great!" << endl;
 }

⌨️ 快捷键说明

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