I am trying to reverse a string without using "strrev"...naay sayup nya ga libug jud ko
By the way, this is TurboC
#include <stdio.h>
int reverse(char r);
main ()
{
int i,j;
char a[10];
char temp;
clrscr ();
printf("Enter a string: ");
gets(a);
reverse(a[i],temp);
getch();
}
int reverse(char r){
for (i=0;a[i]!='\0';i++);
i--;
for (j=0;j <= i/2 ;j++)
{
temp = a[j];
a[j] = a[i-j];
a[i-j] = temp;
}
printf("%s",a);
getch();
}