Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralRe: is this the correct/best way to set file size? Pin
George_George18-Jul-06 22:26
George_George18-Jul-06 22:26 
AnswerRe: is this the correct/best way to set file size? Pin
earl17-Jul-06 4:57
earl17-Jul-06 4:57 
GeneralRe: is this the correct/best way to set file size? Pin
George_George17-Jul-06 20:51
George_George17-Jul-06 20:51 
GeneralRe: is this the correct/best way to set file size? Pin
earl18-Jul-06 6:40
earl18-Jul-06 6:40 
GeneralRe: is this the correct/best way to set file size? [modified] Pin
George_George18-Jul-06 22:28
George_George18-Jul-06 22:28 
GeneralRe: is this the correct/best way to set file size? Pin
earl19-Jul-06 3:14
earl19-Jul-06 3:14 
GeneralRe: is this the correct/best way to set file size? Pin
George_George19-Jul-06 20:34
George_George19-Jul-06 20:34 
QuestionEdit box Pin
SandhyaSri17-Jul-06 0:08
SandhyaSri17-Jul-06 0:08 
AnswerRe: Edit box Pin
Parthi_Appu17-Jul-06 0:23
Parthi_Appu17-Jul-06 0:23 
AnswerRe: Edit box Pin
_AnsHUMAN_ 17-Jul-06 0:27
_AnsHUMAN_ 17-Jul-06 0:27 

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.