I want to read file from byte to byte. But my program breaks on the first `while`

```
 ifstream infile("new.pdf",ifstream::binary);
 ofstream outfile("file.pdf",ofstream::binary);
 char *c;
 while(infile.read(c,sizeof(char)))
 {
    mpz_t M;
    mpz_t K;
    mpz_init2(M,10);
    mpz_set_ui(M,(int)c);
    mpz_init2(K,10);
    mpz_powm(K,M,e,n);
    char *x;
    mpz_get_str(x,10,K);
    outfile.write(x,sizeof(char));
 }

 infile.close();
 outfile.close();
 system("pause");
 infile.open("file.pdf",ifstream::binary);
 outfile.open("newt.pdf",ofstream::binary);
 while(infile.read(c,sizeof(char)))
 {
    mpz_t C;
    mpz_t K;
    mpz_init2(K,10);
    mpz_init2(C,10);
    int x=(int)c;
    mpz_set_ui(K,x);
    mpz_powm(C,K,d,n);
    char *s;
    mpz_get_str(s,10,C);
    outfile.write(s,sizeof(char));
  }
 infile.close();
 outfile.close();

```

What's the problem?

I need to ecnrypt file and then encrypt it.
So I decided to read byte from input file, ecnrypt it and the write to another file.