B
blackneos940
Guest
I tried it this way, from a Website:
But it just gives me these Errors:
I know about the whole "gets" thing being dangerous if used improperly, but why is "strrev" not working.....? :< I assume it's in the string.h Header, but.... Anyway, thanks for any advice guys...... Gee, learning to Program can be HARD on your own....... D:
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char arr[100];
printf("Enter a string to reverse\n");
gets(arr);
strrev(arr);
printf("Reverse of entered string is \n%s\n",arr);
return 0;
}
But it just gives me these Errors:
Code:
Print_Reverse_String.c: In function ‘main’:
Print_Reverse_String.c:12:4: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]
gets(arr);
^
Print_Reverse_String.c:14:4: warning: implicit declaration of function ‘strrev’ [-Wimplicit-function-declaration]
strrev(arr);
^
/tmp/ccirfxGT.o: In function `main':
Print_Reverse_String.c:(.text+0x2e): warning: the `gets' function is dangerous and should not be used.
Print_Reverse_String.c:(.text+0x3f): undefined reference to `strrev'
collect2: error: ld returned 1 exit status
I know about the whole "gets" thing being dangerous if used improperly, but why is "strrev" not working.....? :< I assume it's in the string.h Header, but.... Anyway, thanks for any advice guys...... Gee, learning to Program can be HARD on your own....... D: