Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22101

Why strrev() in C is not working with char*?

$
0
0

Using C programming, with GCC in windows (with CodeBlocks)Why this code doesn't work (running it gives empty console window)

# include <stdio.h># include <string.h>int main(){  char* str = "hello";  printf("%s", strrev(str));}

but using an array works fine

char str[] = "hello";

Note that strrev function prototype is:

char *strrev(char *str);

Viewing all articles
Browse latest Browse all 22101

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>