Click here to Skip to main content
15,917,321 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: _findfirst and fopen very slow Pin
leon de boer31-Jan-19 14:54
leon de boer31-Jan-19 14:54 
GeneralRe: _findfirst and fopen very slow Pin
Stefan_Lang31-Jan-19 21:36
Stefan_Lang31-Jan-19 21:36 
GeneralRe: _findfirst and fopen very slow Pin
leon de boer1-Feb-19 4:42
leon de boer1-Feb-19 4:42 
GeneralRe: _findfirst and fopen very slow Pin
Stefan_Lang1-Feb-19 4:59
Stefan_Lang1-Feb-19 4:59 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 5:44
cristiapi1-Feb-19 5:44 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 6:24
cristiapi1-Feb-19 6:24 
GeneralRe: _findfirst and fopen very slow Pin
leon de boer1-Feb-19 21:40
leon de boer1-Feb-19 21:40 
GeneralRe: _findfirst and fopen very slow Pin
cristiapi1-Feb-19 23:35
cristiapi1-Feb-19 23:35 
GeneralRe: _findfirst and fopen very slow Pin
leon de boer2-Feb-19 0:33
leon de boer2-Feb-19 0:33 
AnswerRe: _findfirst and fopen very slow Pin
Stefan_Lang31-Jan-19 21:27
Stefan_Lang31-Jan-19 21:27 
AnswerRe: _findfirst and fopen very slow Pin
Joe Woodbury1-Feb-19 5:36
professionalJoe Woodbury1-Feb-19 5:36 
AnswerRe: _findfirst and fopen very slow Pin
cristiapi2-Feb-19 1:13
cristiapi2-Feb-19 1:13 
Questionwrite in .xlsx extension excel file using c++ Pin
Member 1413460229-Jan-19 23:49
Member 1413460229-Jan-19 23:49 
AnswerRe: write in .xlsx extension excel file using c++ Pin
Richard MacCutchan29-Jan-19 23:52
mveRichard MacCutchan29-Jan-19 23:52 
AnswerRe: write in .xlsx extension excel file using c++ Pin
leon de boer30-Jan-19 2:09
leon de boer30-Jan-19 2:09 
RantC++ Typedefs Pin
nitrous_00729-Jan-19 4:45
nitrous_00729-Jan-19 4:45 
GeneralRe: C++ Typedefs Pin
Richard MacCutchan29-Jan-19 5:41
mveRichard MacCutchan29-Jan-19 5:41 
GeneralRe: C++ Typedefs Pin
David Crow29-Jan-19 6:20
David Crow29-Jan-19 6:20 
GeneralRe: C++ Typedefs Pin
Joe Woodbury29-Jan-19 9:45
professionalJoe Woodbury29-Jan-19 9:45 
GeneralRe: C++ Typedefs Pin
CPallini29-Jan-19 10:35
mveCPallini29-Jan-19 10:35 
GeneralRe: C++ Typedefs Pin
Stefan_Lang29-Jan-19 21:16
Stefan_Lang29-Jan-19 21:16 
GeneralRe: C++ Typedefs Pin
leon de boer30-Jan-19 3:20
leon de boer30-Jan-19 3:20 
QuestionWhere do you place your #includes? Pin
den2k8828-Jan-19 23:49
professionalden2k8828-Jan-19 23:49 
AnswerRe: Where do you place your #includes? Pin
Daniel Pfeffer29-Jan-19 0:32
professionalDaniel Pfeffer29-Jan-19 0:32 
If a header file depends for its compilation on another header file, the second header file is included in the first.
// header1.h

// depends on contents of header2.h for compilation
#include "header2.h"
If a source file depends for its compilation on a header file, that header file is included in the source file.
// source.c

// depends on contents of header1.h for compilation
#include "header1.h"

In your case, <windows.h> is needed only in the source file, so it is included only there. Note that this also helps porting - the header file (which is O/S-independent) does not need changing, but the source file (which is O/S-dependent) does.

I admit that my method could cause a file to be included multiple times. This is not as big a problem as it used to be:
  1. Modern compilers often cache header files
  2. SSDs are much faster than HDDs
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.

GeneralRe: Where do you place your #includes? Pin
den2k8829-Jan-19 21:12
professionalden2k8829-Jan-19 21:12 

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.