
C++
爱吃肉编程
这个作者很懒,什么都没留下…
展开
-
C++ primer plus (第六版)第七章arrfun1.cpp代码及解释
如有失误之处,还恳请指教!!!// arrfun1.cpp -- functions with an array argument#include <iostream>//定义一个int类型的变量Arsize,并且将其用const限定符限定表明其始终不可修改,因此在属性上类似为常量const int ArSize = 8;//函数原型,声明了一个返回值为int类型,具有两个参...原创 2019-01-20 15:14:39 · 201 阅读 · 0 评论 -
C++ primer plus (第六版)第七章例题代码及解释
如有失误之处,欢迎大家指正!// calling.cpp -- defining, prototyping, and calling a function// 将包含特定功能(输入输出流函数)的头文件包含进来#include &amp;lt;iostream&amp;gt;// 函数声明(函数原型),作用是告诉编译器在后面的代码中会有一个这种格式的函数(因为函数的定义在函数调用之后,// 而计算机的执...原创 2019-01-20 15:11:24 · 380 阅读 · 0 评论 -
C++ primer plus (第六版)第七章arrfun2.cpp代码及解释
如有失误之处,还恳请指教!!!// arrfun2.cpp -- functions with an array argument#include <iostream>const int ArSize = 8;int sum_arr(int arr[], int n);// use std:: instead of using directiveint main(){ ...原创 2019-01-20 15:17:10 · 194 阅读 · 0 评论 -
C++ primer plus (第六版)第七章arrfun3.cpp 代码及解释
如有失误之处,还恳请指教!!!// arrfun3.cpp -- array functions and const#include <iostream>const int Max = 5;// function prototypes//函数原型,返回值为int类型,有两个参数,一个是double类型的数组,一个是int类型。int fill_array(double a...原创 2019-01-20 15:18:21 · 258 阅读 · 0 评论 -
C++ primer plus (第六版)第七章arrfun4.cpp代码及解释
如有失误之处,还恳请指教!!!// arrfun4.cpp -- functions with an array range#include <iostream>const int ArSize = 8;//函数原型:返回值int类型,含有两个参数,两个参数均为指针int sum_arr(const int *begin, const int *end);int main(...原创 2019-01-20 15:19:31 · 182 阅读 · 0 评论 -
C++ primer plus (第六版)第七章arrobj.cpp代码及解释
如有失误之处,还恳请指教!!!//arrobj.cpp -- functions with array objects#include <iostream>#include <array>#include <string>const int Seasons = 4;using namespace std;//使用array对象来存储四个季度,表示这...原创 2019-01-20 15:20:26 · 245 阅读 · 1 评论 -
C++ primer plus (第六版)第七章strctfun.cpp代码及解释
如有失误之处,还恳请指教!!!// strctfun.cpp -- functions with a structure argument#include <iostream>#include <cmath>// structure declarations//结构声明struct polar{ double distance; // ...原创 2019-01-20 15:21:23 · 268 阅读 · 0 评论 -
代码解析
如有失误之处,还恳请指教!!!(缺少例题8.5,打开8.5的代码时,发现自己写的全不见了#######)8.1// inline.cpp -- using an inline function#include <iostream>// an inline function definition//内联函数定义。使用内联函数有两种措施:1. 在函数声明前加上关键字inline...原创 2019-04-01 21:00:48 · 354 阅读 · 0 评论