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

📄 rtn_ref.cpp

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

struct book 
{
  char author[64];
  char title[64];
  float price;
};

book library[3] = {
  {"Jamsa and Klander", "Jamsa's C/C++ Programmer's Bible", 49.95},
  {"Klander", "Hacker Proof", 54.95},
  {"Jamsa and Klander", "1001 Visual Basic Programmer's Tips", 54.95}};

book& get_book(int i)
 {
   if ((i >= 0) && (i < 3))
     return(library[i]);
   else
     return(library[0]);
 }

void main(void)
 {
   cout << "About to get book 0\n";
   book& this_book = get_book(0);
   cout << this_book.author << ' ' << this_book.title;
   cout << ' ' << this_book.price;
 }

⌨️ 快捷键说明

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