当前位置: 技术问答>linux和unix
为什么在linux下我用不了strrev这个函数?
来源: 互联网 发布时间:2015-10-21
本文导语: 我在一段C程序中使用了 函数名: strrev 功 能: 串倒转 用 法: char *strrev(char *str); 这个函数,编译的时候提示错误: main.o: In function `LTrim': main.o(.text+0x9ac): undefined reference to `strrev' main.o(.text+0x9c4): undefine...
我在一段C程序中使用了
函数名: strrev
功 能: 串倒转
用 法: char *strrev(char *str);
这个函数,编译的时候提示错误:
main.o: In function `LTrim':
main.o(.text+0x9ac): undefined reference to `strrev'
main.o(.text+0x9c4): undefined reference to `strrev'
collect2: ld returned 1 exit status
make: *** [Loadr3] Error 1
难道在linux下C没有这个函数,要自己写?
函数名: strrev
功 能: 串倒转
用 法: char *strrev(char *str);
这个函数,编译的时候提示错误:
main.o: In function `LTrim':
main.o(.text+0x9ac): undefined reference to `strrev'
main.o(.text+0x9c4): undefined reference to `strrev'
collect2: ld returned 1 exit status
make: *** [Loadr3] Error 1
难道在linux下C没有这个函数,要自己写?
|
char * strrev(char *s)
{
static char r[1024]; int i, j, l;
for (l = 0; s[l] != ''; l++)
;
for (i = 0, j = l - 1; i
{
static char r[1024]; int i, j, l;
for (l = 0; s[l] != ''; l++)
;
for (i = 0, j = l - 1; i