1.提取字符串2.提取指定长度的字符串3.提取指定字符为止的字符串4.取仅包含指定字符集的字符串5.取到指定字符集为止的字符串#include 
int main(){ char str[512]={0}; sscanf("123456","%s",str); printf("str...
                            
                            
                                分类:
其他好文   时间:
2014-05-12 17:15:19   
                                阅读次数:
322
                             
                    
                        
                            
                            
                                普通排序:直接分配一个同等大小的数组,反向copy即可.char* Reverse(char* 
s){ //将q指向字符串最后一个字符 char* q = s ; while( *q++ ) ; q -= 2 ; //分配空间,存储逆序后的字符串。 
char* p = newchar[sizeof(...
                            
                            
                                分类:
其他好文   时间:
2014-05-12 16:30:14   
                                阅读次数:
338
                             
                    
                        
                            
                            
                                一.内存对齐的初步讲解内存对齐可以用一句话来概括:“数据项只能存储在地址是数据项大小的整数倍的内存位置上”例如int类型占用4个字节,地址只能在0,4,8等位置上。例1:#include 
struct xx{ char b; int a; int c; char d;};int main(){ st...
                            
                            
                                分类:
其他好文   时间:
2014-05-10 19:52:54   
                                阅读次数:
323
                             
                    
                        
                            
                            
                                C++开发的项目难免会用到STL的string,使用管理都比char数组(指针)方便的多,但在得心应手的使用过程中也要警惕几个小陷阱,避免我们项目出bug却迟迟找不到原因。1. 
结构体中的string赋值问题直接通过一个例子说明,下面的例子会输出什么:#include #include #i...
                            
                            
                                分类:
编程语言   时间:
2014-05-05 23:33:45   
                                阅读次数:
413
                             
                    
                        
                            
                            
                                Dijkstra。 1 #include 2 #include 3 4 #define INF 
0xfffffff 5 6 int map[105][105]; 7 int dp[105]; 8 char visit[105]; 9 10 int 
main() {11 int n, ...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 22:34:42   
                                阅读次数:
406
                             
                    
                        
                            
                            
                                双字节字符集(Double Byte Character 
Set,缩写:DBCS)是指电脑的字符编码中,使用了两个字节的所有字符集合。这种字符集以汉语、日语和韩语(合称CJK,即Chinese、Japanese、Korean的首字母)的字符最具代表性,所以有时也专指CJK的字符集。http://zh...
                            
                            
                                分类:
数据库   时间:
2014-05-05 22:16:20   
                                阅读次数:
420
                             
                    
                        
                            
                            
                                拷贝构造函数何时会被调用?1. 
对象以值传递的方式传入函数参数2.对象以值传递的方式从函数返回3.对象需要通过另外一个对象进行初始化下面我们来看代码://#include //using 
namespace std;//template //T:队列的类型,char,int,double,包括自己....
                            
                            
                                分类:
编程语言   时间:
2014-05-02 17:33:17   
                                阅读次数:
401
                             
                    
                        
                            
                            
                                (1)打印字符char c;printf("%c",c);(2)打印整形int 
i;printf("%d",i); //有符号十进制数printf("%u",i); //无符号十进制数(3)打印浮点数float 
f;printf("%f",f);(4)打印指针int *p;pri...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 16:13:07   
                                阅读次数:
378
                             
                    
                        
                            
                            
                                #include #include #include int main(int argc,char 
**argv){ FILE *fp_src,*fp_des; char buf[128]; int num; if(argc!=3) { 
printf("t...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 16:06:36   
                                阅读次数:
562
                             
                    
                        
                            
                            
                                #include #include float get_cpu_clock_speed(){ FILE 
*fp; char buffer[1024]; size_t bytes_read; char *match; float clock_speed; 
fp=fo...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 14:20:39   
                                阅读次数:
392