摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 struct Student 6 { 7 int num; 8 ... 阅读全文
posted @ 2018-08-01 16:04 borter 阅读(1916) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 struct Student 6 { 7 int num; 8 ... 阅读全文
posted @ 2018-08-01 16:03 borter 阅读(452) 评论(0) 推荐(0) 编辑
摘要: 1 #define NULL 0 2 #include 3 4 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 5 using namespace std; 6 struct Student 7 { 8 long n... 阅读全文
posted @ 2018-08-01 16:02 borter 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 struct Student 6 { 7 int num; 8 ... 阅读全文
posted @ 2018-08-01 16:02 borter 阅读(401) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 6 int main(int argc, char** argv) { 7 ... 阅读全文
posted @ 2018-08-01 16:01 borter 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 6 struct Person 7 { 8 string name;... 阅读全文
posted @ 2018-08-01 16:00 borter 阅读(379) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 6 struct Date 7 { 8 int month; 9 int d... 阅读全文
posted @ 2018-08-01 15:59 borter 阅读(328) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 struct Person 6 { 7 char name[20]; ... 阅读全文
posted @ 2018-08-01 15:59 borter 阅读(942) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 void sort(... 阅读全文
posted @ 2018-08-01 15:58 borter 阅读(705) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 void swap(... 阅读全文
posted @ 2018-08-01 15:57 borter 阅读(455) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 void swap(... 阅读全文
posted @ 2018-08-01 15:54 borter 阅读(609) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 void swap(int,... 阅读全文
posted @ 2018-08-01 15:53 borter 阅读(77) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 i... 阅读全文
posted @ 2018-08-01 15:52 borter 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 char **p; 7 c... 阅读全文
posted @ 2018-08-01 15:51 borter 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 v... 阅读全文
posted @ 2018-08-01 15:50 borter 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 int max(in... 阅读全文
posted @ 2018-08-01 15:31 borter 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 char str1[... 阅读全文
posted @ 2018-08-01 15:30 borter 阅读(72) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 char *str="I lov... 阅读全文
posted @ 2018-08-01 15:29 borter 阅读(298) 评论(0) 推荐(1) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 char str[]="I lo... 阅读全文
posted @ 2018-08-01 15:28 borter 阅读(848) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 void outpu... 阅读全文
posted @ 2018-08-01 15:28 borter 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 int a[3][4... 阅读全文
posted @ 2018-08-01 15:26 borter 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 3 /* run this program using the console pauser or add your own getch, system("pause") or input loop */ 4 using namespace std; 5 int main(int argc, char** argv) { 6 int a[3][4... 阅读全文
posted @ 2018-08-01 15:26 borter 阅读(1073) 评论(0) 推荐(0) 编辑
摘要: C++ 有用的书籍Essential C++ 中文版C++ Primer Plus 第6版中文版C++ Primer中文版(第5版) 阅读全文
posted @ 2018-08-01 15:15 borter 阅读(110) 评论(0) 推荐(0) 编辑
摘要: C++ 有用的网站C++ Programming Language Tutorials ? C++ 编程语言教程。C++ Programming ? 这本书涵盖了 C++ 语言编程、软件交互设计、C++ 语言的现实生活应用。C++ FAQ ? C++ 常见问题Free Country ? Free 阅读全文
posted @ 2018-08-01 15:14 borter 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 面向对象类库标准的 C++ 面向对象类库定义了大量支持一些常见操作的类,比如输入/输出 I/O、字符串处理、数值处理。面向对象类库包含以下内容: 标准的 C++ I/O 类String 类数值类STL 容器类STL 算法STL 函数对象STL 迭代器STL 分配器本地化库异常处理类杂项支持库 阅读全文
posted @ 2018-08-01 15:12 borter 阅读(160) 评论(0) 推荐(0) 编辑
摘要: 标准函数库标准函数库分为以下几类: 输入/输出 I/O字符串和字符处理数学时间、日期和本地化动态分配其他宽字符函数 阅读全文
posted @ 2018-08-01 15:11 borter 阅读(256) 评论(0) 推荐(0) 编辑
摘要: C++ 标准库C++ 标准库可以分为两部分: 标准函数库: 这个库是由通用的、独立的、不属于任何类的函数组成的。函数库继承自 C 语言。面向对象类库: 这个库是类及其相关函数的集合。C++ 标准库包含了所有的 C 标准库,为了支持类型安全,做了一定的添加和修改。 阅读全文
posted @ 2018-08-01 15:10 borter 阅读(151) 评论(0) 推荐(0) 编辑
摘要: C++ STL 教程在前面的章节中,我们已经学习了 C++ 模板的概念。C++ STL(标准模板库)是一套功能强大的 C++ 模板类,提供了通用的模板类和函数,这些模板类和函数可以实现多种流行和常用的算法和数据结构,如向量、链表、队列、栈。 阅读全文
posted @ 2018-08-01 15:08 borter 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Hello World! 这是我的第一个 CGI 程序上面的 C++ 程序是一个简单的程序,把它的输出写在 STDOUT 文件上,即显示在屏幕上。在这里,值得注意一点,第一行输出 Content-type:text/html\r\n\r\n。这一行发送回浏览器,并指定要显示在浏览器窗口上的内容类型。 阅读全文
posted @ 2018-08-01 15:07 borter 阅读(155) 评论(0) 推荐(0) 编辑
摘要: Web 服务器配置在您进行 CGI 编程之前,请确保您的 Web 服务器支持 CGI,并已配置成可以处理 CGI 程序。所有由 HTTP 服务器执行的 CGI 程序,都必须在预配置的目录中。该目录称为 CGI 目录,按照惯例命名为 /var/www/cgi-bin。虽然 CGI 文件是 C++ 可执 阅读全文
posted @ 2018-08-01 15:05 borter 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Web 浏览为了更好地了解 CGI 的概念,让我们点击一个超链接,浏览一个特定的网页或 URL,看看会发生什么。 您的浏览器联系上 HTTP Web 服务器,并请求 URL,即文件名。Web 服务器将解析 URL,并查找文件名。如果找到请求的文件,Web 服务器会把文件发送回浏览器,否则发送一条错误 阅读全文
posted @ 2018-08-01 15:04 borter 阅读(321) 评论(0) 推荐(0) 编辑
摘要: C++ Web 编程什么是 CGI?公共网关接口(CGI),是一套标准,定义了信息是如何在 Web 服务器和客户端脚本之间进行交换的。CGI 规范目前是由 NCSA 维护的,NCSA 定义 CGI 如下:公共网关接口(CGI),是一种用于外部网关程序与信息服务器(如 HTTP 服务器)对接的接口标准 阅读全文
posted @ 2018-08-01 15:03 borter 阅读(139) 评论(0) 推荐(0) 编辑
摘要: C++ 多线程多线程是多任务处理的一种特殊形式,多任务处理允许让电脑同时运行两个或两个以上的程序。一般情况下,两种类型的多任务处理:基于进程和基于线程。 基于进程的多任务处理是程序的并发执行。基于线程的多任务处理是同一程序的片段的并发执行。多线程程序包含可以同时运行的两个或多个部分。这样的程序中的每 阅读全文
posted @ 2018-08-01 15:02 borter 阅读(89) 评论(0) 推荐(0) 编辑
摘要: C++ 信号处理信号是由操作系统传给进程的中断,会提早终止一个程序。在 UNIX、LINUX、Mac OS X 或 Windows 系统上,可以通过按 Ctrl+C 产生中断。 有些信号不能被程序捕获,但是下表所列信号可以在程序中捕获,并可以基于信号采取适当的动作。这些信号是定义在 C++ 头文件 阅读全文
posted @ 2018-08-01 15:01 borter 阅读(142) 评论(0) 推荐(0) 编辑
摘要: C++ 预处理器预处理器是一些指令,指示编译器在实际编译之前所需完成的预处理。 所有的预处理器指令都是以井号(#)开头,只有空格字符可以出现在预处理指令之前。预处理指令不是 C++ 语句,所以它们不会以分号(;)结尾。 我们已经看到,之前所有的实例中都有 #include 指令。这个宏用于把头文件包 阅读全文
posted @ 2018-08-01 15:00 borter 阅读(162) 评论(0) 推荐(0) 编辑
摘要: C++ 模板模板是泛型编程的基础,泛型编程即以一种独立于任何特定类型的方式编写代码。 模板是创建泛型类或函数的蓝图或公式。库容器,比如迭代器和算法,都是泛型编程的例子,它们都使用了模板的概念。 每个容器都有一个单一的定义,比如 向量,我们可以定义许多不同类型的向量,比如 vector <int> 或 阅读全文
posted @ 2018-08-01 14:59 borter 阅读(123) 评论(0) 推荐(0) 编辑
摘要: C++ 命名空间假设这样一种情况,当一个班上有两个名叫 Zara 的学生时,为了明确区分它们,我们在使用名字之外,不得不使用一些额外的信息,比如他们的家庭住址,或者他们父母的名字等等。 同样的情况也出现在 C++ 应用程序中。例如,您可能会写一个名为 xyz() 的函数,在另一个可用的库中也存在一个 阅读全文
posted @ 2018-08-01 14:58 borter 阅读(85) 评论(0) 推荐(0) 编辑
摘要: C++ 动态内存了解动态内存在 C++ 中是如何工作的是成为一名合格的 C++ 程序员必不可少的。C++ 程序中的内存分为两个部分: 栈:在函数内部声明的所有变量都将占用栈内存。堆:这是程序中未使用的内存,在程序运行时可用于动态分配内存。很多时候,您无法提前预知需要多少内存来存储某个定义变量中的特定 阅读全文
posted @ 2018-08-01 14:56 borter 阅读(132) 评论(0) 推荐(0) 编辑
摘要: C++ 异常处理异常是程序在执行期间产生的问题。C++ 异常是指在程序运行时发生的特殊情况,比如尝试除以零的操作。 异常提供了一种转移程序控制权的方式。C++ 异常处理涉及到三个关键字:try、catch、throw。 throw: 当问题出现时,程序会抛出一个异常。这是通过使用 throw 关键字 阅读全文
posted @ 2018-08-01 14:55 borter 阅读(105) 评论(0) 推荐(0) 编辑
摘要: C++ 文件和流到目前为止,我们已经使用了 iostream 标准库,它提供了 cin 和 cout 方法分别用于从标准输入读取流和向标准输出写入流。 阅读全文
posted @ 2018-08-01 14:54 borter 阅读(99) 评论(0) 推荐(0) 编辑