HelloWorld

ASM,C,LUA,LINUX(gentoo)
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

指针的指针

Posted on 2011-09-20 22:31  光铭  阅读(156)  评论(0)    收藏  举报
#include <stdio.h>
#define TRUE 1
#define FALSE 0
int find_char(char **strings,char value)
{
char *string;
while((string = *strings++) != NULL)
{
while(*string != 0)
{
if(*string++ == value)
return TRUE;
}
}
}

int find_char_2(char **strings,char value)
{
while(**strings != 0)
{
if(*(*strings)++ == value)
return TRUE;
}
}
这里比如说 char **strings={"hello","world"};
指针是地址,指针的指针就是地址的地址
那么strings就是'h'的地址的地址,*strings就是'h'的地址,**strings就是'h'