Click here to Skip to main content
15,903,201 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Creating a file of fixed size Pin
Eytukan10-Mar-09 18:40
Eytukan10-Mar-09 18:40 
AnswerRe: Creating a file of fixed size Pin
«_Superman_»10-Mar-09 18:57
professional«_Superman_»10-Mar-09 18:57 
AnswerRe: Creating a file of fixed size Pin
CPallini10-Mar-09 19:51
mveCPallini10-Mar-09 19:51 
GeneralRe: Creating a file of fixed size Pin
Hamid_RT10-Mar-09 22:02
Hamid_RT10-Mar-09 22:02 
GeneralRe: Creating a file of fixed size Pin
CPallini10-Mar-09 22:55
mveCPallini10-Mar-09 22:55 
GeneralRe: Creating a file of fixed size Pin
Hamid_RT11-Mar-09 0:34
Hamid_RT11-Mar-09 0:34 
AnswerRe: Creating a file of fixed size Pin
Stuart Dootson11-Mar-09 0:49
professionalStuart Dootson11-Mar-09 0:49 
GeneralRe: Creating a file of fixed size Pin
Raj-Ekoham DwitiyoNasti11-Mar-09 3:22
Raj-Ekoham DwitiyoNasti11-Mar-09 3:22 
Thanks a lot for the reply.
But can u gimme a C++ style solution,i.e. using fstream.
I am trying it this way:
void Create_Page_File()
{
	    int iCount;
	char wbuf[PAGESIZE];//,FBuff[PAGESIZE];
	int rand_no;
	/* Initialise buffer before use */
	memset (wbuf, 0, PAGESIZE);
	ifstream infile("/tmp/TestData.bin");
	ofstream outfile("/tmp/TestData.bin");
     
 	for( iCount = 0; iCount < PAGESIZE; iCount++ )
	{
		 //Prepare random data 
			rand_no = rand( );
		    wbuf[ iCount ] = ( rand_no % 0xff );	
		//}
		outfile.write( &( wbuf[ iCount ]), 1 );
		cout<< wbuf[iCount]<<" ";
    }

}

But the resulting file I am getting is in character format,nd not hexadecimal.
Please Help me.
Thanks and regards,

Purusottam Mishra
Systems Executive

GeneralRe: Creating a file of fixed size Pin
Stuart Dootson11-Mar-09 3:35
professionalStuart Dootson11-Mar-09 3:35 
GeneralRe: Creating a file of fixed size Pin
Raj-Ekoham DwitiyoNasti11-Mar-09 4:18
Raj-Ekoham DwitiyoNasti11-Mar-09 4:18 
GeneralRe: Creating a file of fixed size Pin
Stuart Dootson11-Mar-09 4:25
professionalStuart Dootson11-Mar-09 4:25 
GeneralRe: Creating a file of fixed size Pin
Raj-Ekoham DwitiyoNasti11-Mar-09 4:43
Raj-Ekoham DwitiyoNasti11-Mar-09 4:43 
GeneralRe: Creating a file of fixed size Pin
Stuart Dootson11-Mar-09 5:37
professionalStuart Dootson11-Mar-09 5:37 
QuestionProblem with using of CPropertySheet Pin
ssm198411910-Mar-09 16:38
ssm198411910-Mar-09 16:38 
AnswerRe: Problem with using of CPropertySheet Pin
«_Superman_»10-Mar-09 18:58
professional«_Superman_»10-Mar-09 18:58 
GeneralRe: Problem with using of CPropertySheet Pin
ssm198411910-Mar-09 19:36
ssm198411910-Mar-09 19:36 
GeneralRe: Problem with using of CPropertySheet Pin
«_Superman_»10-Mar-09 19:37
professional«_Superman_»10-Mar-09 19:37 
GeneralRe: Problem with using of CPropertySheet Pin
ssm198411910-Mar-09 20:10
ssm198411910-Mar-09 20:10 
GeneralRe: Problem with using of CPropertySheet Pin
David Crow11-Mar-09 3:07
David Crow11-Mar-09 3:07 
GeneralRe: Problem with using of CPropertySheet Pin
ssm198411913-Mar-09 16:44
ssm198411913-Mar-09 16:44 
QuestionCompiler MATLAB file to C++ Pin
deserterize10-Mar-09 10:51
deserterize10-Mar-09 10:51 
AnswerRe: Compiler MATLAB file to C++ Pin
Yusuf10-Mar-09 11:28
Yusuf10-Mar-09 11:28 
GeneralRe: Compiler MATLAB file to C++ Pin
CPallini10-Mar-09 11:47
mveCPallini10-Mar-09 11:47 
GeneralRe: Compiler MATLAB file to C++ Pin
deserterize11-Mar-09 11:55
deserterize11-Mar-09 11:55 
QuestionMemory Usage of Application. Pin
ERLN10-Mar-09 9:56
ERLN10-Mar-09 9:56 

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.