I wrote an encryption in C++ and the target is java .class file.
I wrote an sample code to test IO.
#include <iostream>
using namespace std;
#define Length 600
int main () {
FILE* fp=fopen("a.class","r");
FILE* save=fopen("b.class","w");
while(!feof(fp))
{
char a[Length];
fgets(a,Length,fp);
fprintf(save,"%s",a);
}
return 0;
}
a.class looks like below in Sublime
cafe babe 0000 0034 0057 0700 0201 002a 7477 2f63 6f6d 2f6d 696e 6463 7261 6674
And this is my result
Êþº¾/Logger;footerFormlogFormtmle.html/examples/notifications.htmlSourceFile³
So, how to read it properly in c++?