Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #define MAXLINE 1000
- void reverse(char*);
- int getlen(char*,int);
- void main()
- {
- int i=0;
- char line[MAXLINE];
- printf("nEnter anythingn");
- while((getlen(line,MAXLINE))>1)
- {
- reverse(line);
- }
- printf("%s",line);//problem here
- }
- int getlen(char line[],int len)
- {
- int c,i=0;
- while((c=getchar())!=EOF && c!='n' && (i<(len-2)))//last two for n and
- {
- line[i]=c;
- ++i;
- }
- if(c=='n')
- {
- line[i]=c;
- ++i;
- }
- line[i]='