copy use putc and getc