Click here to Skip to main content
15,914,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: installshield Pin
Nish Nishant30-Nov-01 22:07
sitebuilderNish Nishant30-Nov-01 22:07 
GeneralRe: installshield Pin
Kannan Kalyanaraman1-Dec-01 16:56
Kannan Kalyanaraman1-Dec-01 16:56 
GeneralTrying to capture and print the screen. Pin
GD30-Nov-01 14:50
GD30-Nov-01 14:50 
GeneralRe: Trying to capture and print the screen. Pin
Nish Nishant30-Nov-01 15:00
sitebuilderNish Nishant30-Nov-01 15:00 
GeneralRe: Trying to capture and print the screen. Pin
Rick York30-Nov-01 17:56
mveRick York30-Nov-01 17:56 
GeneralRichedit2.dll / Richedit32.dll Pin
Nnamdi Onyeyiri30-Nov-01 12:42
Nnamdi Onyeyiri30-Nov-01 12:42 
GeneralRe: Richedit2.dll / Richedit32.dll Pin
Henry Jacobs1-Dec-01 4:54
Henry Jacobs1-Dec-01 4:54 
GeneralFile Encryption & Read/Write in Binary Mode Pin
valikac30-Nov-01 12:28
valikac30-Nov-01 12:28 
Hi,
I am working on an encryption program. There are two versions. One is text encryption and the second is binary encrytion. The text encryption is fairly simply. The downside to the text version is that is only works on text files. One the other hand, I cannot get the binary encryption program to work.

There are two problems. First, I cannot copy complete raw data from any file and save it into a character array. I have tried giving the array a specific size and I have tried dynamically allocating the size of the array based on the size of the ifstream.

ifstream openFile;
openFile.open(x, ios::in | ios::binary);
openFile.seekg(0, ios::end);
size = openFile.tellg();

char *temp;
temp = new char(size);

openFile.read((char *) temp, sizeof(temp));

The code above does work, however, "sizeof(temp)" always output a 4 even if its subscript is 1000. the char * does not affect it because I saw the same number even if I use:

char temp[100];

How do you read raw data (binary) from any file and save it in memory so you can make specific encryption and then write it back in binary mode?

Thanks,
Kuphryn


GeneralRe: File Encryption & Read/Write in Binary Mode Pin
Nnamdi Onyeyiri30-Nov-01 12:35
Nnamdi Onyeyiri30-Nov-01 12:35 
GeneralRe: File Encryption & Read/Write in Binary Mode Pin
Anders Molin30-Nov-01 12:43
professionalAnders Molin30-Nov-01 12:43 
GeneralRe: File Encryption & Read/Write in Binary Mode Pin
valikac1-Dec-01 12:37
valikac1-Dec-01 12:37 
GeneralRe: File Encryption & Read/Write in Binary Mode Pin
Anders Molin1-Dec-01 12:42
professionalAnders Molin1-Dec-01 12:42 
GeneralRe: File Encryption & Read/Write in Binary Mode Pin
valikac3-Dec-01 12:44
valikac3-Dec-01 12:44 
GeneralAnother way to get the size of a file Pin
Ravi Bhavnani1-Dec-01 13:36
professionalRavi Bhavnani1-Dec-01 13:36 
GeneralSetting a different font for an application Pin
billb211230-Nov-01 11:00
billb211230-Nov-01 11:00 
Questionopengl + dll??? Pin
Kuniva30-Nov-01 10:21
Kuniva30-Nov-01 10:21 
GeneralMinimize Pin
kakuni30-Nov-01 9:58
kakuni30-Nov-01 9:58 
GeneralRe: Minimize Pin
Ravi Bhavnani30-Nov-01 10:39
professionalRavi Bhavnani30-Nov-01 10:39 
GeneralRe: Minimize Pin
kakuni30-Nov-01 11:06
kakuni30-Nov-01 11:06 
GeneralRe: Minimize Pin
Fazlul Kabir30-Nov-01 11:19
Fazlul Kabir30-Nov-01 11:19 
Generaldear god help me Pin
Abadon30-Nov-01 9:36
Abadon30-Nov-01 9:36 
GeneralRe: dear god help me Pin
Chris Losinger30-Nov-01 9:47
professionalChris Losinger30-Nov-01 9:47 
GeneralRe: dear god help me Pin
Fazlul Kabir30-Nov-01 9:59
Fazlul Kabir30-Nov-01 9:59 
GeneralRe: dear god help me Pin
Chris Losinger30-Nov-01 10:57
professionalChris Losinger30-Nov-01 10:57 
GeneralRe: dear god help me Pin
Nish Nishant30-Nov-01 14:55
sitebuilderNish Nishant30-Nov-01 14:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.