给两个例子:
1、在设备上
u32 sqlite3_get_s8(sqlite3_res *res, u32 nrow, s8 *fields, s8 **dst)
{
u32 ret;
//这里有问题,返回是一个s8的指针类型
*dst = (s8 )sqlite3_get_value(res, nrow, fields, &ret);
return ret;
}
出现
root@OpenWrt:/tmp# ./test
Bus error
root@OpenWrt:/tmp
2、在pc上
char *buff="aaaaa";
int get_char_p(char **buf)
};
int main()
{
char *eth=NULL;
get_char_p(ðeth);
printf("eth %s\n", eth);
return 0;
}
[root@localhost t]# ./a.out
段错误 (core dumped)
[root@localhost t]#
1、在设备上
u32 sqlite3_get_s8(sqlite3_res *res, u32 nrow, s8 *fields, s8 **dst)
{
u32 ret;
//这里有问题,返回是一个s8的指针类型
*dst = (s8 )sqlite3_get_value(res, nrow, fields, &ret);
return ret;
}
出现
root@OpenWrt:/tmp# ./test
Bus error
root@OpenWrt:/tmp
2、在pc上
char *buff="aaaaa";
int get_char_p(char **buf)
{
//这里有问题,返回是一个s8的指针类型
};
int main()
{
char *eth=NULL;
get_char_p(ðeth);
printf("eth %s\n", eth);
return 0;
}
[root@localhost t]# ./a.out
段错误 (core dumped)
[root@localhost t]#