English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

my string doesn't get reversed at all

2007-05-09 22:05:27 · 3 answers · asked by subha 1 in Computers & Internet Programming & Design

3 answers

Please go to
http://www.chami.com/tips/delphi/012297D.html
http://www.sswug.org/nlread.asp?d=3/20/2007&t=1&id=30722
http://weblogs.sqlteam.com/mladenp/archive/2006/03/19/9350.aspx

2007-05-09 22:12:04 · answer #1 · answered by Anonymous · 0 0

Firstly give a clear question about your doubt.

Let it be in any language

Take that string in an string variable.
Open a 'for' loop with 2 variables like one starts with 0 and other starts with the length of the string to be reversed.
access every charecter from the string and copy it to the another string with array count of other variable.( a[i]=b[j])

the resultant string a will be the reverse string.

2007-05-10 05:15:57 · answer #2 · answered by raji_badari 2 · 0 0

#include
#include
#include

int main() {

char s[1000];
int i;
int len=0;

while (1) {

printf("\n\n\tEnter a string : ");
gets(s);

printf("\n");

for(i=0;s[i];i++) {
printf("%c",s[i]);
}
len=strlen(s);
printf("\n\n");
for(i=len-1; s[i], i>=0; i--)
printf("%c",s[i]);
}
return 0;
}

2007-05-10 06:38:57 · answer #3 · answered by iyiogrenci 6 · 0 0

fedest.com, questions and answers