自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 收藏
  • 关注

原创 va_list

参数列表#include #include #include #include using namespace std;void stat_log(const char* format, ...){ char stat_str[500]; memset(stat_str, 0, sizeof(stat_str)); va_list vl; va_start(vl, f

2015-06-30 20:03:10 370

原创 字符串压缩

2.字符串压缩通过键盘输入一串小写字母(a~z)组成的字符串。请编写一个字符串压缩程序,将字符串中连续出席的重复字母进行压缩,并输出压缩后的字符串。压缩规则:1. 仅压缩连续重复出现的字符。比如字符串"abcbc"由于无连续重复字符,压缩后的字符串还是"abcbc".2. 压缩字段的格式为"字符重复的次数+字符"。例如:字符串"xxxyyyyyyz"压缩后就成为"3x6yz"要

2015-06-19 14:36:16 413

原创 字符串过滤

华为校招机试试题11.字符串过滤通过键盘输入一串小写字母(a~z)组成的字符串。请编写一个字符串过滤程序,若字符串中出现多个相同的字符,将非首次出现的字符过滤掉。比如字符串“abacacde”过滤结果为“abcde”。要求实现函数:  void stringFilter(const char pInputStr, long lInputLen, char pOutputSt

2015-06-17 16:08:45 695

原创 dynamic_cast.cpp

动态映射             安全类型向下映射#include #include #include #include using namespace std;class shape{ public: shape() { count++; } virtual ~shape() { count--; } virtual void draw() const =

2015-06-15 11:52:06 390

原创 operator.cpp

运算符的重载1. 友元2. 内部#include using namespace std;class CTmp{ public: //friend const CTmp operator++(CTmp& tmp); //friend const CTmp operator++(CTmp& tmp, int); CTmp(int iflag=0):i(ifla

2015-06-15 11:49:19 438

原创 iostream.cpp

输入输出流的现实设置#include #include #include using namespace std;/*使用setprecision(n)可控制输出流显示浮点数的数字个数。C++默认的流输出数值有效位是6。如果setprecision(n)与setiosflags(ios::fixed)合用,可以控制小数点右边的数字个数。setiosflags(ios::fixe

2015-06-15 11:47:57 439

原创 friend_class.cpp

友元类的一种设计#include #include #define SZ 20struct holder{ private: int a[SZ]; public: void initialize(); struct pointer{ private: holder* h; int * p; public: void initi

2015-06-15 11:46:36 330

原创 string -- value

字符串分割     字符串和值得转换#include #include #include #include using namespace std;templateconst char* to_string(T number){ std::stringstream ss; ss<<number; std::string str; ss>>str; return str

2015-06-15 11:43:15 632

原创 stdarg.cpp

格式化输入输出#include #include #include #include using namespace std;void print(const char* s1, ...){ va_list arg_ptr; const char* pz = NULL; va_start(arg_ptr, s1); do { pz = va_arg(arg_ptr

2015-06-15 11:33:27 318

原创 c++ 重载运算符

#include using namespace std;class CTmp{ public: //friend const CTmp operator++(CTmp& tmp); //friend const CTmp operator++(CTmp& tmp, int); CTmp(int iflag=0):i(iflag) { } void print(

2015-06-12 16:36:02 332

原创 string转换和分割

#include #include #include #include using namespace std;templateconst char* to_string(T number){ std::stringstream ss; ss<<number; std::string str; ss>>str; return str.c_str();}templat

2015-06-11 15:05:35 430

转载 time_t数据类型表示的最迟时间

转载请注明出处: http://blog.csdn.net/zhangyang0402/archive/2010/07/18/5744475.aspx 一、基本系统数据类型-time_t在unix/linux系统中,时间的表示方法是以1970年1月1日00:00:00所经过的秒数,使用基本系统数据类型time_t表示,在/usr/include下查找time_t类型的定义. 1

2015-06-05 14:27:04 2038

转载 linux下C获取系统时间的方法

Reference: http://net.pku.edu.cn/~yhf/linux_c/function/04.htmlasctime(将时间和日期以字符串格式表示)  相关函数  time,ctime,gmtime,localtime 表头文件  #include 定义函数  char * asctime(const struct tm * timep

2015-06-05 14:22:10 284

转载 mysql中int、bigint、smallint 和 tinyint的区别详细介绍

最近使用mysql数据库的时候遇到了多种数字的类型,主要有int,bigint,smallint和tinyint。其中比较迷惑的是int和smallint的差别。今天就在网上仔细找了找,找到如下内容,留档做个总结:使用整数数据的精确数字数据类型。 bigint 从 -2^63 (-9223372036854775808) 到 2^63-1 (9223372036854775807)

2015-06-03 20:03:50 351

转载 SVN使用log,list,cat,diff查看所有及特定文件版本信息

svn log          展示给你主要信息:每个版本附加在版本上的作者与日期信息和所有路径修改。 svn diff          显示特定修改的行级详细信息。 svn cat          取得在特定版本的某一个文件显示在当前屏幕。 svn list          显示一个目录在某一版本存在的文件。找出一个文件或目录的历史信息,使用svn log命令,svn l

2015-06-03 18:57:08 662

转载 gdb命令小结

转自:http://blog.csdn.net/huqinwei987/article/details/23548239 之前想验证一些关于堆栈的问题,但是没什么好方法,printf实在局限,流于表面,只间表象(值、范围、规律)不见真身(地址、寄存器、过程),所以想到了gdb——一个强大的调试工具,还能看汇编代码,现在先把这两天学的常用的命令做一个小结,以后有用到的可能再来更新一下:

2015-06-02 11:52:27 423

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除