C++
交心连手
这个作者很懒,什么都没留下…
展开
-
C++练习:返回值指针or引用
#include <cstddef>using std::size_t;#include <iostream>using std::cout; using std::endl;// code to illustrate declarations of array-related typesint arr[10]; // arr is an array of ten ints原创 2017-03-08 22:02:45 · 204 阅读 · 0 评论 -
C++练习:递归输出vector
递归输出vector// recursive.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "recursive.h"#include <cassert>#include <iostream>using std::endl; using std::cout; using std::cerr;int main(){ vecto原创 2017-03-08 22:06:14 · 799 阅读 · 0 评论 -
C++练习:返回数组的引用
#include <iostream>using std::cout; using std::endl;// get returns a reference to an element in the given arrayint &get(int *arry, int index) { return arry[index]; }//返回给定数组元素的引用int main() { in原创 2017-03-08 21:57:15 · 2238 阅读 · 0 评论