Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- char c;
- char* mas = malloc(sizeof(char));
- char* start = mas;
- while((c = getchar()) != EOF)
- {
- *(mas) = c;
- mas++;
- start = realloc(start, mas-start);
- }
- printf("\n");
- for(char* it = mas; it >= start; it--)
- {
- printf("%c", *it);
- }
- printf("\n");
- free(start);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment