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

C / C++ / MFC

 
AnswerRe: Porting C++ code from linux to Windows Pin
Rilhas21-Jul-06 13:10
Rilhas21-Jul-06 13:10 
Questionhow to print from MFC to command Line Pin
kanna_p17-Jul-06 1:56
kanna_p17-Jul-06 1:56 
AnswerRe: how to print from MFC to command Line Pin
see me17-Jul-06 2:03
see me17-Jul-06 2:03 
QuestionRe: how to print from MFC to command Line Pin
David Crow17-Jul-06 2:40
David Crow17-Jul-06 2:40 
AnswerRe: how to print from MFC to command Line Pin
Monty217-Jul-06 3:08
Monty217-Jul-06 3:08 
AnswerRe: how to print from MFC to command Line Pin
kanna_p17-Jul-06 17:47
kanna_p17-Jul-06 17:47 
GeneralRe: how to print from MFC to command Line Pin
David Crow18-Jul-06 2:38
David Crow18-Jul-06 2:38 
AnswerRe: how to print from MFC to command Line Pin
earl17-Jul-06 4:50
earl17-Jul-06 4:50 
QuestionHINSTANCE for DLL Pin
Manjunath S17-Jul-06 1:50
Manjunath S17-Jul-06 1:50 
AnswerRe: HINSTANCE for DLL Pin
Nibu babu thomas17-Jul-06 1:55
Nibu babu thomas17-Jul-06 1:55 
QuestionRe: HINSTANCE for DLL Pin
David Crow17-Jul-06 2:42
David Crow17-Jul-06 2:42 
QuestionRe: HINSTANCE for DLL Pin
Manjunath S17-Jul-06 3:35
Manjunath S17-Jul-06 3:35 
QuestionAfter AfxBeginthread... Pin
Smith#17-Jul-06 1:18
Smith#17-Jul-06 1:18 
AnswerRe: After AfxBeginthread... Pin
see me17-Jul-06 1:54
see me17-Jul-06 1:54 
AnswerRe: After AfxBeginthread... Pin
ThatsAlok17-Jul-06 2:17
ThatsAlok17-Jul-06 2:17 
AnswerRe: After AfxBeginthread... Pin
tanvon malik17-Jul-06 2:49
tanvon malik17-Jul-06 2:49 
QuestionHow get a list of LogSources ? Pin
fx920017-Jul-06 0:22
fx920017-Jul-06 0:22 
Questionis this the correct/best way to set file size? [modified] Pin
George_George17-Jul-06 0:09
George_George17-Jul-06 0:09 
Hello everyone,


I have verified that the following approach works to set the size of a file (newly created file) to be 100 bytes, but I am not sure whether it is the correct/best way to have a maximum portability (I need to write code on both Windows and Linux).

Could anyone give me any comments?

<br />
#include "fcntl.h"<br />
#include "sys/types.h"<br />
#include "sys/stat.h"<br />
#include "io.h"<br />
#include "stdio.h"<br />
<br />
int main()<br />
{<br />
	FILE* file = fopen ("foo123", "w+");<br />
	<br />
	fseek (file, 99, SEEK_SET);<br />
<br />
	fprintf (file, "x");<br />
<br />
	fclose (file);<br />
<br />
	return 0;<br />
}<br />



thanks in advance,
George

-- modified at 6:11 Monday 17th July, 2006
AnswerRe: is this the correct/best way to set file size? Pin
David Crow17-Jul-06 2:44
David Crow17-Jul-06 2:44 
GeneralRe: is this the correct/best way to set file size? Pin
George_George17-Jul-06 3:05
George_George17-Jul-06 3:05 
GeneralRe: is this the correct/best way to set file size? Pin
David Crow17-Jul-06 3:49
David Crow17-Jul-06 3:49 
GeneralRe: is this the correct/best way to set file size? Pin
George_George17-Jul-06 4:08
George_George17-Jul-06 4:08 
QuestionRe: is this the correct/best way to set file size? Pin
David Crow17-Jul-06 4:14
David Crow17-Jul-06 4:14 
AnswerRe: is this the correct/best way to set file size? Pin
George_George17-Jul-06 20:49
George_George17-Jul-06 20:49 
GeneralRe: is this the correct/best way to set file size? Pin
David Crow18-Jul-06 2:34
David Crow18-Jul-06 2:34 

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.