C/C++
kennethf6986
这个作者很懒,什么都没留下…
展开
-
C++程序设计原理与实践读书笔记之Hello World
#include "std_lib_facilities.h" int main() { cout<<"Hellom World!\n"; return 0; } 我用的是vc6.0进行编译的, 结果报错 ompiling...hello.cppd:\c++\ws\cpphello\hello.cpp(1) : fatal error C1083: Cann...2010-08-29 22:38:08 · 192 阅读 · 0 评论 -
c++基础之头文件
头文件的作用 早期的编程语言如Basic、Fortran没有头文件的概念,C++/C语言的初学者虽然会用使用头文件,但常常不明其理。这里对头文件 的作用略作解释: (1)通过头文件来调用库功能。在很多场合,源代码不便(或不准)向用户公布,只要向用户提供头文件和二进制的库即可。用 户只需要按照头文件中的接口声明来调用库功能,而不必关心接口怎么实现的。编译器会从库中提取相应的代码。 (2)头...原创 2010-11-12 22:29:53 · 137 阅读 · 0 评论 -
面试题目之删除字符串
问题描述: 在给定字符串中查找所有特定子串并删除,如果没有找到相应子串,则不作任何操作。 要求实现函数: int delete_sub_str(const char *str, const char *sub_str, char *result_str) 【输入】 str:输入的被操作字符串 sub_str:需要查找并删除的特定子字符串 【输出】 ...原创 2010-11-09 23:31:40 · 112 阅读 · 0 评论 -
面试题目之简单算法【快速排序】
H公司2010年笔试题目,快速排序 [code="c"] #include "stdio.h" #include "conio.h" #include "string.h" void main() { void quickSort( int date[], int low, int high); int a[6]; printf("请输入6个数字\n"); for(...原创 2010-11-08 23:25:58 · 90 阅读 · 0 评论 -
面试题目之字符串处理【把字符中的小写字母专为大写】
[code="c"] #include "stdio.h" #include "conio.h" #include "string.h" void main() { void upcase(char *cr, char *us); char ss[20]; char uus[20]; printf("Please input a String:\n"); ...原创 2010-11-08 23:00:33 · 118 阅读 · 0 评论 -
面试题目之字符串处理【把输入的字符转为数字,并逆序】
[code="c"] #include "stdio.h" #include "conio.h" #include "string.h" void main() { unsigned IsSymmetry(char *c); char *s; char ss[20]; printf("Please input a String:\n"); scanf("%s&q原创 2010-11-08 22:41:43 · 169 阅读 · 0 评论 -
面试题目之字符串处理【字符逆序与判断回文数】
[code="c"] #include "stdio.h" #include "conio.h" #include "string.h" void main() { char ss[20]; char *p; printf("请输入字符串\n"); scanf("%s",ss); p = ss; p += strlen(ss)-1; // 把指原创 2010-11-08 21:55:59 · 100 阅读 · 0 评论 -
chapter12 例程
[code="c++"] #include "Simple_window.h" #include "Graph.h" int main() { using namespace Graph_lib; Simple_window win(Point(100,100), 600, 400, "axis"); Axis xa(Axis::x, Point(20,300)...原创 2011-04-25 21:06:34 · 80 阅读 · 0 评论 -
VS2005 C++ 项目怎样添加“依赖附加项”、“库目录”和“包含目录”
1. 添加编译所需要(依赖)的 lib 文件 [解决方案资源管理器]“项目->属性->配置属性->连接器->输入->附加依赖项”里填写“winsock.lib”,多个 lib 以空格隔开。(等同于“#pragma comment(lib, "winsock.lib") ”语句) 2. 添加库(Libs)文件目录 方法 1:[解决方案资源管理器]“项目->属性->配置属性->...原创 2011-01-07 23:55:29 · 124 阅读 · 0 评论 -
10.11.2 IO之读取结构化的值
利用标准输入循环来解决一个实际问题 假定要处理一个温度读数文件,其结构为: {year 1990} {year 1991{month jun }} {year 1992{month jan (1 0 61.5)} {month feb (1 1 64) (2 2 65.2)}} {year 2000 {month feb (1 1 68)(2 3 66.66)(1 0 67.2)...原创 2010-12-23 22:46:13 · 88 阅读 · 0 评论 -
10.6 IO错误处理
[code="c++"] #include "../../std_lib_facilities.h" #include "./token.h" void fill_vector(istream& ist, vector& v, char terminator ) { int i=0; while(ist>>i) v.push_back(i); if(ist.eof()) r...原创 2010-12-18 16:02:58 · 112 阅读 · 0 评论 -
IO读取本地文件并创建一个新文件
[code="c++"] #include "../../std_lib_facilities.h" struct Reading{ int hour; double temperation; Reading(int h, double t):hour(h),temperation(t) {}; }; void main() { couthour>>tempe...原创 2010-12-17 23:23:03 · 130 阅读 · 0 评论 -
一个简单的计算器程序
[code="c++"] const char number = '8'; const char quit = 'q'; const char print = ';'; const string prompt = ">"; const string result = "="; const char name = 'a'; const char let = 'L'; cons...原创 2010-12-05 00:53:00 · 182 阅读 · 0 评论