- 浏览: 37185 次
- 性别:
- 来自: 上海
最近访客 更多访客>>
最新评论
-
shi5jin:
呵呵,我看的是Effective C++第三版,第一个item ...
站在巨人肩上的思考[连载] (5) -
bigpanda:
欢迎讨论远程数据库和rpc的编程。
“《Effective ...
站在巨人肩上的思考[连载] (5) -
spinach:
读完这两节,我基本就一个字,“基本帅呆了”。
站在巨人肩上的思考 [连载] (3) -
spinach:
终于等到了,慢慢看。
站在巨人肩上的思考 [连载] (2) -
spinach:
期待下文
站在巨人肩上的思考 [连载] (1)
<st1:chmetcnv tcsc="0" w:st="on" unitname="C" sourcevalue="1.3" numbertype="1" negative="False" hasspace="True">1.3 C</st1:chmetcnv>++的设计
- int intVar;
- double yourCash, myCash;
- class Student;
- std::string studentName;
- int intMax(int, int);
<v:shapetype id="_x0000_t202" path="m,l,21600r21600,l21600,xe" coordsize="21600,21600" o:spt="202"><v:stroke joinstyle="miter"></v:stroke><v:path o:connecttype="rect" gradientshapeok="t"></v:path></v:shapetype><v:shapetype id="_x0000_t75" path="m@4@5l@4@11@9@11@9@5xe" coordsize="21600,21600" o:spt="75" o:preferrelative="t" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"></v:path><o:lock aspectratio="t" v:ext="edit"></o:lock></v:shapetype>
- int intVar = 0;
- double yourCash = 0.0, myCash = 10e+10;
- class myClass {}; //an empty class;
- std::string studentName(“”);
- int intVar; //declaration;
- intVar = 3; //definition;
- //class definition;
- class Student {
- int _studentNo;
- char _gender;
- std::string _birth;
- public:
- int number(void) const;
- char gender(void) const;
- std::string birth(void) const;
- };
- //a function definition/implement;
- int intMax(int a, int b) {
- return (a > b ? a : b);
- }
- int
- Student::number(void) const {
- return _studentNo;
- }
- using namespace gavin::math;
- Matrix matrix1(3, 5), matrix(5,3);
- matrix[0][0] = 3, matrix1[0][1] = 2;
- //…初始化matrix1和matrix2;
- Matrix result( matrix1 * matrix2 );
- cout << “We can print out the result: “ << result << endl;
- cout << “after multiply with 3 is: “ << 3*result << endl;
- cout << “And we can plus them: “ << matrix1 + matrix2 << endl;
- cout << “Sure can minus: “ << matrix1 – matrix2 << endl;
- cout << “Even get a negative: “ << -matrix2 << endl;
- cout << “Get the Matrix’s size: “ << matrix2.size() << endl;
- Matrix::iterator iter = result.begin(),
- iterEnd = result.end();
- for(; iter != iterEnd; ++iter) {
- cout << *iter << endl;
- }
- printMatrix(matrix1); printMatrix(matrix2);
- matrixPlus(matrix1, matrix2);
发表评论
-
站在巨人肩上的思考[连载] (8)
2007-12-03 14:58 11265.2 数组 5.2.2 字符串文字量 ... -
站在巨人肩上的思考[连载] (7)
2007-12-03 14:56 11104.8 枚举 枚举是表示具有共同属性的整 ... -
一种“标准”的虚函数机制简介
2007-11-09 11:07 1245编译器是如何针对虚函数产生可以再运行时刻确定被调用函数 ... -
A Generic Ostream Iterator
2007-09-07 08:37 1327by Christopher Diggins November ... -
我能从构造函数调用虚函数吗?
2007-09-06 11:18 2745可以。不过你得悠着点 ... -
为何我的构造函数不太对劲?
2007-09-06 10:57 1149类似这样的问题千奇百怪。例如: ... -
如何在类中定义常量?
2007-09-06 10:51 2500如果你想得到一个可用 ... -
为何空类的大小不是零?
2007-09-06 10:46 1859为了确保两个不同对象的地址不同,必须如此。也正因为如此,new ... -
我应该怎样处理内存泄漏?
2007-09-06 10:43 944很 简单,只要写“不漏 ... -
您可以推荐一种编写代码的标准吗?
2007-09-06 10:36 1297C++ 代码编写标准的要点是:根据使用 C++ 的具体的 ... -
如何使用异常?
2007-09-05 09:34 985请参考 TC++PL 章节 8.3、第十四章,以及附录 E。附 ... -
为何C++既有指针也有引用?
2007-09-05 09:28 868C++ 的指针继承于 C,若要移除指针,势必造成严重的兼容性 ... -
可以在构造函数里抛出异常吗?析构函数里呢?
2007-09-05 09:24 2320可以:当你不能正常地初始化(构造)对象时,你应该在 ... -
站在巨人肩上的思考[连载] (6)
2007-05-04 09:31 1931第4章 类型和声明 4.3 字符类型 “由8 ... -
站在巨人肩上的思考[连载] (5)
2007-04-23 19:40 2332最近做个小项目,有点忙。事情倒是不难,就是有点杂, ... -
站在巨人肩上的思考[连载] (4)
2007-04-10 11:13 1792首先感谢 spinach 的鼓励与支持。你给了我很大的动力, ... -
站在巨人肩上的思考 [连载] (3)
2007-04-09 08:36 2164上一篇中,主要是对C++类设计的一个概览。如果 ... -
站在巨人肩上的思考 [连载] (1)
2007-04-06 08:20 2142[原创。欢迎复制。转载请您注明出处 -- Gavin] Tip ...
相关推荐
20210531-华金证券-卓越商企服务-6989.HK-站在巨人肩膀上的商务物管领军企业.pdf
八年级物理全册1.3站在巨人的肩膀上我国的四大发明素材新版沪科.doc
绿洲APP产品分析报告:站在巨人肩膀上能否看得更远?.pdf
家用电器行业深度:小米集团:站在 “巨人们”的肩膀上看世界.pdf
站在巨人的肩膀上,_迁移学习_Transfer_Learning
站在巨人的肩膀上-scrollView联动
读完本书,受益匪浅,与大家共享!!! 让我们站在巨人的肩膀上。
前辈对错误的总结,让你站在巨人的肩膀上走的更远
使用Java语言开发,站在巨人肩膀上制作了异步非阻塞的IM,采用官方协议适配器解决一台服务器可解决http、websocket、tcp(可以私有定制)的多协议通讯.zip
巨人肩上新巨人.doc
站在巨人的肩上——XX借势营销策划.doc
站在巨人的肩上泛德林恩借势营销策划.docx
站在巨人的肩膀上的项目,感谢zhile大佬的Pandora-Next项目.zip
站在巨人的肩膀上:分层设计在 Nervos 生态系统中的 layer 2区块链上的实际应用-SACC2021年中国系统架构师大会
站在巨人的肩上--泛德林恩借势营销策划.doc
使用Java语言开发,站在巨人肩膀上制作了异步非阻塞的IM,采用官方协议适配器解决一台服务器可解决http、websocket、tcp(可以私有定制)的多协议通讯.zip
八年级物理全册第一章第三节站在巨人的肩膀上教学课件新版沪科版
背靠开放平台 如何在巨人肩膀上把握市场机.docx
20210706-浦银国际-宝胜国际-3813.HK-站在巨人的肩膀上;利润率改善空间大.pdf
八年级物理全册 1.3 站在巨人的肩膀上 我国的四大发明素材 (新版)沪科版(通用).doc