编写一个函数reverse_string(char * string)(递归实现)
实现:将参数字符串中的字符反向排列。
#include
#include
#include
int reverse_string(char * str)
{
assert(str);
int len=strlen(str);
char *ch=str+len-1;
whi...
分类:
编程语言 时间:
2015-04-07 13:53:58
阅读次数:
171
//编写一个函数reverse_string(char * string)(递归实现)
//实现:将参数字符串中的字符反向排列。
//要求:不能使用C函数库中的字符串操作函数。
#include
#include
void reverse_string(char const * string)
{
assert( string != NULL );
if( *string != '\0' ...
分类:
编程语言 时间:
2015-04-06 15:44:43
阅读次数:
186
/*编写一个函数reverse_string(char * string)(递归实现)
实现:将参数字符串中的字符反向排列。
要求:不能使用C函数库中的字符串操作函数。*/
#include
#include
void reverse_string(char const * string)
{
assert( string != NULL );
if( *string != '\0' ...
分类:
编程语言 时间:
2015-04-05 21:58:58
阅读次数:
155
本文的例子全部来自github上cglib的官方文档,有关cglib的教程少之又少,如果想学习觉得还是看看诸如Hibernate和Spring的源码来的实在。
package com.tang;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame;
import j...
分类:
其他好文 时间:
2015-04-05 16:03:41
阅读次数:
187
//将源字符串加const,表明其为输入参数char* strcat(char* strDest , const char*s trSrc){ //后文return address,故不能放在assert断言之后声明address char* address=strDest; as...
分类:
其他好文 时间:
2015-04-04 22:33:41
阅读次数:
1206
assert宏的原型定义在中,其作用是假设它的条件返回错误,则终止程序运行,原型定义:#include void assert( int expression );assert的作用是现计算表达式 expression ,假设其值为假(即为0),那么它先向stderr打印一条出错信息,然后通过调用 ...
分类:
其他好文 时间:
2015-04-04 13:41:07
阅读次数:
191
//判断一个数是不是回文数
#include
#include
int panduan(int *p)
{
int t = 0;
int n = *p;
assert( *p != NULL );
//每次取出最后一个数乘10加到前边去
while( *p != NULL )
{
t = t * 10 + *p % 10;
*p = *p / 10;
}
//如果是...
分类:
编程语言 时间:
2015-04-03 17:22:06
阅读次数:
150
//判断一个字符串是不是回文字符串
#include
#include
int panduan( char *p )
{
char *q ;
assert( *p != NULL );
q = p;
while( *p != '\0')
{
p++;
}
p--;
while(*q != '\0')
{
if( *p == *q)
{
p--;
...
分类:
编程语言 时间:
2015-04-03 15:17:41
阅读次数:
113
前言:
本文目前仅限于获取和设置剪贴板的文本内容,还未涉及到图片等资源;
示例:
一:设置剪贴板文本内容(支持一般符号,特殊符号未测试)
bool SetClipBoardText(LPCSTR text,HWND hWnd)
{
ASSERT(hWnd);
//打开剪贴板
if ( !::OpenClipboard(hWnd) )
return fa...
分类:
其他好文 时间:
2015-04-03 13:32:09
阅读次数:
192
一、编译安装过程优化1、减小Nginx编译后的文件大小在编译nginx时,默认以debug模式进行,而在debug的模式下会插入很多跟踪和ASSERT之类的信息,编译完成后,一个nginx要有好几兆字节,而编译之前取消debug模式,编译完成之后只有几百千字节,因此,在编译之前,修改相关源码:..
分类:
其他好文 时间:
2015-04-01 20:21:55
阅读次数:
131