- 博客(6)
- 资源 (3)
- 收藏
- 关注
原创 编写一个函数,将字符串循环右移n位
void reversal(char *str,int low,int high){ if(low >= high) return; char tmp; while(low <= high) { tmp = str[low]; str[low] = str[high]; str[high] = tmp; low++; high--; }}void loo
2016-02-23 15:11:43 2284
原创 在字符串中找到第一个只出现一次的字符
#define MAX_CH_CNT (256)char find_first_not_repeat_char(const char *str){ char ret = '\0'; int chCnt[MAX_CH_CNT] = {0}; char chStack[MAX_CH_CNT]; memset(chStack,0,MAX_CH_CNT); int index =
2016-02-22 11:03:14 249
原创 打印1到最大的N位数
static int sNumber[10] = {0,1,2,3,4,5,6,7,8,9};void Print_Arr(char *a,int n){int index = n - 1;while(index >= 0){if(a[index] == 0){index--;}else{break;}}while(index >
2016-02-19 10:32:11 198
原创 const考题
const表示为只读。const 和 const 完全等价问题归结为 const *p 和 * const p 区别;只需要看const 后是什么类型;前者const 修饰的是*p,他是p所指向的内容为read-only;而 后者 const 修饰的是p, 即指针变量p本身为 read-only;从内存的角度来看: *const p 变量p存放在re
2015-06-01 17:56:00 327
原创 指针与引用
一、指针指针式用来存放某个变量地址值的变量。指针可以修饰所有的基本数据类型,并且可以指向数组、函数、指针以及文件。指针的考题:a)一个整型数(An integer)b) 一个指向整型数的指针(A pointer to an integer) c) 一个指向指针的的指针,它指向的指针是指向一个整型数(A pointer to a pointer to an inte
2015-06-01 17:39:39 314
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人