03 2013 档案

摘要:一、代码:LibType_String.cc 主要熟悉标准库string类型的初始化、定义、常见的操作等。#include <iostream>#include <cctype>using namespace std;int main (){ /*1.define and intilatize a string object*/ string s1; // default Constructor cout<<"s1-->"+s1<<endl; string s2(s1); cout<<"s2--&g 阅读全文
posted @ 2013-03-23 21:43 Davim 阅读(641) 评论(0) 推荐(0)
摘要:一、代码:read-inUnknownNumStr.cc ,功能:输出输入所有的字符串直到遇见文件结束操作符/*read in the unknown number string object*/#include <iostream>using namespace std;int main (){ string word; //read until end-of-file,writting each word to a new line while (cin >> word) cout << word <<endl; return 0;}二、编译 阅读全文
posted @ 2013-03-20 23:30 Davim 阅读(1139) 评论(0) 推荐(1)
摘要:C++准确说是一门中级语言,介于汇编和高级语言之间吧,要求程序员了解计算机的内部数据存储。个人认为,作为学生还是花功夫学C++,因为《设计模式》《数据结构》这些课程基本上还是C++应付的比较好(我的切身体会),学习 C++,认真阅读c++ primer,而后配合 The ADAPTIVE Communication Environment (ACE)了解设计模式, 再看看《深入浅出STL》,就会发现其他语言都一样,不变的是思想本身。在以下领域,C++有着根本性的优势:低级系统程序设计、高级系统程序设计、嵌入式程序设计、数值科学计算、通用程序设计以及混合系统设计等等。让我们略微展开描述一下: 1 阅读全文
posted @ 2013-03-12 11:28 Davim 阅读(10654) 评论(9) 推荐(5)
摘要:与在IDE中编译相比,命令行模式编译速度更快,并可以避免被IDE产生的一些附加信息所干扰,下面介绍在Win7 命令行下编译C++。1、首先要正确安装Visual Studio 2010,安装路径(D:\Program Files)2、设置环境变量:PATH=$PATH$;D:\Program Files\Microsoft Visual Studio 10.0\VC\binINCLUDE=D:\Program Files\Microsoft Visual Studio 10.0\VC\includeLIB=D:\Program Files\Microsoft Visual Studio 10. 阅读全文
posted @ 2013-03-11 23:48 Davim 阅读(5563) 评论(1) 推荐(1)
摘要:一、C++ 编写—>运行编辑器(vi)编写 源程序)编译器 g++ -c 目标文件 .o结尾的文件连接器 g++ 可执行文件(命令文件)调试器 gdb运行 命令+Enter二、Hello World 程序 hello.cc 1 /*the first C++ program*/ 2 3 #include <iostream> 4 5 using namespace std; 6 7 //main function 8 9 int main()10 11 {12 13 cout<<"Hello world!"<<endl;14 15 阅读全文
posted @ 2013-03-08 15:45 Davim 阅读(546) 评论(0) 推荐(0)