Hi I was trying to do the following code reversing a string without using arrays but its giving me segmentation fault. I hope you guys can help me out.
#include <strings.h>
#include <string.h>
#include <stdio.h>
void main()
{
char *s, *c;int i,j;
printf("enter the string\n");
scanf("%s", s);
for(i = strlen(s), j = 0; i >= 0, j <= strlen(s); i--, j++){
printf("%c\n", *(s+i));
*(c+j) = *(s + i);
}
}