资源简介
很是经典啊
关于函数的使用很多使用C++编写超经典的坦克大战
代码片段和文件信息
/*
* This file contains code from “C++ Primer Fourth Edition“ by Stanley B.
* Lippman Jose Lajoie and Barbara E. Moo and is covered under the
* copyright and warranty notices given in that book:
*
* “Copyright (c) 2005 by objectwrite Inc. Jose Lajoie and Barbara E. Moo.“
*
*
* “The authors and publisher have taken care in the preparation of this book
* but make no expressed or implied warranty of any kind and assume no
* responsibility for errors or omissions. No liability is assumed for
* incidental or consequential damages in connection with or arising out of the
* use of the information or programs contained herein.“
*
* Permission is granted for this code to be used for educational purposes in
* association with the book given proper citation if and when posted or
* reproduced.Any commercial use of this code requires the explicit written
* permission of the publisher Addison-Wesley Professional a division of
* Pearson Education Inc. Send your request for permission stating clearly
* what code you would like to use and in what specific way to the following
* address:
*
* Pearson Education Inc.
* Rights and Contracts Department
* 75 Arlington Street Suite 300
* Boston MA 02216
* Fax: (617) 848-7047
*/
#include
using std::cout; using std::endl;
#include
using std::size_t;
const size_t arr_size = 7;
int arr1[] = {0123456789};
int main()
{
// arr1 is an array of ints
int *source = arr1;
size_t sz = sizeof(arr1)/sizeof(*arr1); // number of elements
int *dest = new int[sz]; // uninitialized elements
while (source != arr1 + sz)
*dest++ = *source++; // copy element and increment pointers
// print contents of the array
dest -= sz;
for (size_t i = 0; i != sz; ++i)
cout << *dest++ << endl;
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1937 2005-02-09 15:34 6\copy_array.cpp
文件 46 2005-02-01 12:05 6\data\add_item
文件 46 2005-02-01 12:05 6\data\bad_items
文件 19 2005-02-01 14:01 6\data\doWhile
文件 1894 2005-02-09 15:34 6\doWhile.cpp
文件 2401 2005-02-09 15:34 6\exception_example.cpp
文件 1663 2005-02-09 15:34 6\forcount.cpp
文件 690 2005-03-01 14:52 6\makefile
文件 2568 2005-02-09 15:34 6\othercnt.cpp
文件 729 2005-02-01 14:00 6\README.TXT
文件 195 2005-03-01 14:52 6\runpgms.bat
文件 2198 2005-02-09 15:34 6\vowels.cpp
文件 2025 2005-02-09 15:35 6\wdebug.cpp
文件 1568 2005-02-09 15:36 7\badswap.cpp
文件 487 2005-02-09 15:38 7\cfcn_ex.c
文件 2625 2005-02-09 15:40 7\conv-enums.cpp
文件 1575 2005-02-09 15:38 7\count-calls.cpp
文件 10 2005-02-01 14:01 7\data\mainmath
文件 1332 2005-02-09 15:42 7\decl1.h
文件 1334 2005-02-09 15:42 7\decl2.h
文件 2059 2005-02-09 15:36 7\enum-match.cpp
文件 2004 2005-02-09 15:37 7\fact.cpp
文件 1339 2005-02-09 15:42 7\ff.h
文件 1761 2005-02-09 15:39 7\good_printmain.cpp
文件 1698 2005-02-09 15:39 7\inline_shorter.cpp
文件 1406 2005-02-09 15:42 7\localMath.h
文件 1716 2005-02-09 15:36 7\mainmath.cpp
文件 1473 2005-02-09 15:39 7\mainret.cpp
文件 1467 2005-02-01 12:05 7\makefile
文件 1514 2005-02-09 15:36 7\mathstuff.cpp
............此处省略53个文件信息
- 上一篇:RSA算法C语言程序
- 下一篇:大整数乘法 c++ 代码
评论
共有 条评论