#include <stdio.h>
#include <conio.h>
#include <stdlib.h>


char ch;
int i, j;

void make_stroke(char *new_stroke){
        new_stroke=(char *)malloc(2*sizeof(char));
        ch=0;
        i=0;
        while(ch!='\r'){


		ch=getche();
                new_stroke[i]=ch;
                ++i;
                new_stroke=(char *)realloc(new_stroke, (i*sizeof(char)));

        }
--i;

new_stroke[i]='\0';

}

int main(){
char *str;
printf("please, enter: ");
make_stroke(str);
printf("\n");
for(j=0; str[j]!='\0'; ++j)
        printf("%c", str[j]);
getch();
return 0;
}