随笔分类 - C++
record my coding
摘要:题目:Problem Description“Point, point, life of student!”This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too....
阅读全文
摘要:转载自:http://blog.csdn.net/zj510/article/details/8135556感谢原作者-------------------------------------------------------------------------------------------...
阅读全文
摘要:首先将代码附上:头文件: 1 #ifndef STOCK10_H_ 2 #define STOCK10_H_ 3 4 #include 5 6 class Stock 7 { 8 private: 9 std::string company;10 long shares;11 double share_val;12 double total_val;13 void set_tot() { total_val = shares * share_val; }14 public:15 Stock();16 Stock(const std:...
阅读全文
摘要:今天在学习C++Primer PLUS 第十章,在实践其中关于股票的代码时,编译时总出现error C2065错误,让人莫名其妙,最终参考了http://blog.sina.com.cn/s/blog_8216ada701017evx.html的方法将#include "StdAfx.h" 提前,解决了问题。 同时学习了一下stdafx.h这个头文件: 通俗的说应当是由于一个工程中往往会包含很多相同的头文件,因此这个头文件实现了预编译,为了加快编译的效率 参考自:http://baike.baidu.com/link?url=i5Yui5tbaSW2amt5ysR7cmsP
阅读全文
摘要:值调用 就是调用函数时,给形参分配内存空间,将实参拷贝给形参,之后的函数执行中形参和实参就脱离了关系,谁都不影响谁。也就是值调用时,只是用实参的值初始化下形参,之后两者互不影响。例子#include using namespace std; void Swap(int a, int b); int _tmain(int argc, _TCHAR* argv[]) { int x=5, y=10; cout<<"x="<<x<<" y="<<y<<endl;...
阅读全文
浙公网安备 33010602011771号