正是因为字符串不是底子类型。并且有时候还会因为地址不相等出现差错的操作,所以要对字符串进行相关操作时会对比费事。因为即使,但是地址空间却不是同一块。例如:
所以为了便当操作以及防止一些差错,
1. char*strsetchar*str,char i;该函数用字符y替换字符串str中每个字符,回来替换后的字符串地址;例:
回来倒。2. char*strrevcha...
分类:
其他好文 时间:
2015-06-03 00:59:35
阅读次数:
166
本文主要对设计模式进行大概讲解,特别是对创建型设计模式进行简明的解析:
一、设计模式的分类
三大类:
创建型模式,共五种:工厂方法模式、抽象工厂模式、单例模式、建造者模式、原型模式。
结构型模式,共七种:适配器模式、装饰器模式、代理模式、外观模式、桥接模式、组合模式、享元模式。
行为型模式,共十一种:策略模式、模板方法模式、观察者模式、迭代子模式、责任链模式、命...
分类:
其他好文 时间:
2015-06-03 00:58:17
阅读次数:
327
1、 部署CAS-Server
本文以cas-server-3.4.11-release.zip为例,解压提取cas-server-3.4.11/modules/cas-server-webapp-3.4.11.war文件。然后,解压一个新的tomcat,我的目录为【H:\常用软件\03. Java\tomcat\apache-tomcat-6.0.33】,然后把上面提取的文件copy到 ...
分类:
其他好文 时间:
2015-06-03 00:59:31
阅读次数:
462
http://acm.hdu.edu.cn/showproblem.php?pid=5255枚举a和c 求解b#include #include #include #include #include using namespace std ;typedef long long LL ;#define...
分类:
其他好文 时间:
2015-06-03 00:56:10
阅读次数:
120
1152. False MirrorsTime limit: 2.0 secondMemory limit: 64 MBBackgroundWe wandered in the labyrinth for twenty minutes before finally entering the larg...
分类:
其他好文 时间:
2015-06-03 00:56:38
阅读次数:
184
#include #include using namespace std;typedef struct _NODE_{ _NODE_* pRight; _NODE_* pLeft; int e; int Count; void InitMember(int e) ...
分类:
其他好文 时间:
2015-06-03 00:57:17
阅读次数:
105
Well, there are several observations for this problemThe max profit is at least0(buy and sell on the same day);The profit of buying on dayiand selling...
分类:
其他好文 时间:
2015-06-03 00:54:48
阅读次数:
121
电源选项中S0,S1,S2,S3,S4,S5的含义以 ACPI 的规格来说吧!ACPI(Advanced Configuration and Power Interface),即高级配置与电源接口。这种新的能源管理可以通过诸如软件控制'开关'系统,亦可以用Modem信号唤醒和关闭系统。 ACPI在....
分类:
其他好文 时间:
2015-06-03 00:54:34
阅读次数:
199
This is a fundamental and yet classic problem. I share my three solutions here:Iterative solution using stack ---O(n)time andO(n)space;Recursive solut...
分类:
其他好文 时间:
2015-06-03 00:54:17
阅读次数:
101
首先评价一下经常使用的搜索类产品。用的最多的是百度。1,用户界面:百度的界面简单整洁,主要突出搜索的重点,所以通常情况下都是一个大的百度logo,下面是帮助搜索的方向,然后是搜索框。和入目清楚的“百度一下”。右上角则是优化性的功能,不影响主体使用,也方便了主体使用。2,记住用户选择:将鼠标选定在搜索...
分类:
其他好文 时间:
2015-06-03 00:56:09
阅读次数:
171
ioctl控制设备除了读写设备之外,其他功能的实现需要ioctl。如串口的波特率的设定。用户空间:ioctl的应用apiint ioctl(int fd, unsigned long cmd, ...)fd 文件描述符cmd 发送的命令...依赖cmd命令内核空间api int (*ioctl)(....
分类:
其他好文 时间:
2015-06-03 00:53:58
阅读次数:
151
自定义View视图文件查找逻辑之前MVC5和之前的版本中,我们要想对View文件的路径进行控制的话,则必须要对IViewEngine接口的FindPartialView或FindView方法进行重写,所有的视图引擎都继承于该IViewEngine接口,比如默认的RazorViewEngine。但新版...
分类:
其他好文 时间:
2015-06-03 00:54:30
阅读次数:
282
django document 提供了非常详尽的资料:https://docs.djangoproject.com/en/1.8/。 按照django document推荐,搭建开发环境:使用vagrant搭建了ubuntu 14.1系统,python和django版本分别是3.4.3和1.8.2,...
分类:
其他好文 时间:
2015-06-03 00:54:16
阅读次数:
148
【转】威尔逊定理威尔逊定理:,其中p为素数。题目:给定一个正整数n,求表达式:的值。分析:分两种情况讨论。(1)3k+7为素数时,那么由威尔逊定理知道,即此时有,,所以(2)3k+7为合数时,那么3k+7可以写成:,那么很明显a和b在(3k+6)!中都会出现,所以,此时所以,综上,问题就是小于等于n...
分类:
其他好文 时间:
2015-06-03 00:54:09
阅读次数:
134
用sizeof求类的大小,http://blog.csdn.net/szchtx/article/details/1025400,这篇博文给出了非常详尽的举例介绍。但是细心的我还是发现了一个小瑕疵,那就是对如下例子求sizeof(B),在VS下是16不是12!class A{public: i...
分类:
其他好文 时间:
2015-06-03 00:52:13
阅读次数:
128
超时版:/*Given two strings s and t, determine if they are isomorphic.Two strings are isomorphic if the characters in s can be replaced to get t.All occur...
分类:
其他好文 时间:
2015-06-03 00:54:17
阅读次数:
123
1.Add title ,axis Lables, and Legend to Graph:1 x=linspace(-2*pi,2pi,100);2 y1=sin(x);3 y2=cos(x);4 figure5 plot(x,y1,x,y2);6 title('Graph of sine and...
分类:
其他好文 时间:
2015-06-03 00:52:12
阅读次数:
147