i want to revers a arry and store it in another arry and want to print it.
this is the code
some problem in it.
can some one modify it???
is dis rev_str[n-i]=str; correct???
#include <stdio.h>
# include <string.h>
main()
{
int i,m,n,count;
char str[10],rev_str[10];
printf("Enter a String :");
gets(str);
for(i=0;str!='\0';i++)
{
}
m=i;
n=i;
for(i;i>0;i--)
{
rev_str[n-i]=str;
}
printf("new: %s",rev_str);
}
this is the code
some problem in it.
can some one modify it???
is dis rev_str[n-i]=str; correct???
#include <stdio.h>
# include <string.h>
main()
{
int i,m,n,count;
char str[10],rev_str[10];
printf("Enter a String :");
gets(str);
for(i=0;str!='\0';i++)
{
}
m=i;
n=i;
for(i;i>0;i--)
{
rev_str[n-i]=str;
}
printf("new: %s",rev_str);
}
