Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(){
- char test[]="abcdefghijklmnopqrstuvwxyz";
- int lon=strlen(test);
- char *Nstr=malloc(sizeof(char)*lon);
- char *ans;
- ans=Nstr;
- int i;
- for(i=lon-1;i>=0;i--){
- *Nstr=test[i];
- Nstr++;
- }
- *Nstr='\0';
- printf("%s\n%s", test, Nstr);
- free(ans);
- //free(Nstr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement