scanf("%c", &rdata);
rdata should be of type char, not char*
and it will not store the name - just one char
to store the name you need char array
char filename[MAX_PATH]
and use some suitable format, for example %s if name does not contains spaces
same goes for printf