Click here to Skip to main content
15,851,387 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: copying a file in C++17 Pin
Richard MacCutchan5-Dec-23 23:07
mveRichard MacCutchan5-Dec-23 23:07 
AnswerRe: copying a file in C++17 Pin
jschell6-Dec-23 8:04
jschell6-Dec-23 8:04 
Questionprintf without stdio.h Pin
mike74115-Dec-23 6:21
mike74115-Dec-23 6:21 
AnswerRe: printf without stdio.h Pin
Mircea Neacsu5-Dec-23 6:31
Mircea Neacsu5-Dec-23 6:31 
GeneralRe: printf without stdio.h Pin
mike74115-Dec-23 17:23
mike74115-Dec-23 17:23 
GeneralRe: printf without stdio.h Pin
Mircea Neacsu5-Dec-23 17:42
Mircea Neacsu5-Dec-23 17:42 
AnswerRe: printf without stdio.h Pin
Victor Nijegorodov5-Dec-23 6:32
Victor Nijegorodov5-Dec-23 6:32 
AnswerRe: printf without stdio.h Pin
k50545-Dec-23 7:02
mvek50545-Dec-23 7:02 
iostream provides very complex facilities to C++, and requires a great deal of supporting infrastructure. You can get a list of all the include files that a compilation unit needs by using the /showIncludes flag in your compiles (-H for gcc/clang). Using Compiler Explorer, I see over 100 additional files included, including new, string, istream, ostream, atomic and cstdio (which gets you printf), just to name a few. As others have pointed out, you can just go ahead and use printf for example, and not add #include <cstdio> to your source file. However, as compilers evolve, you may find that this is no longer the case, at which point your code will fail to compile. Its good practice to #include all the relevant headers. System headers, at least, will have guards against multiple inclusions, so there's no harm in being explicit about what headers your program, or module, requires.
"A little song, a little dance, a little seltzer down your pants"
Chuckles the clown

GeneralRe: printf without stdio.h Pin
jschell6-Dec-23 8:07
jschell6-Dec-23 8:07 
Questioncopying a file Pin
mike74115-Dec-23 4:24
mike74115-Dec-23 4:24 
AnswerRe: copying a file Pin
Mircea Neacsu5-Dec-23 4:32
Mircea Neacsu5-Dec-23 4:32 
AnswerRe: copying a file Pin
Richard MacCutchan5-Dec-23 5:05
mveRichard MacCutchan5-Dec-23 5:05 
AnswerRe: copying a file Pin
k50545-Dec-23 5:42
mvek50545-Dec-23 5:42 
QuestionMyth of a Myth? Pin
jschell4-Dec-23 4:38
jschell4-Dec-23 4:38 
AnswerRe: Myth of a Myth? Pin
Richard MacCutchan4-Dec-23 5:57
mveRichard MacCutchan4-Dec-23 5:57 
AnswerRe: Myth of a Myth? Pin
Mircea Neacsu4-Dec-23 6:05
Mircea Neacsu4-Dec-23 6:05 
GeneralRe: Myth of a Myth? Pin
harold aptroot6-Dec-23 20:55
harold aptroot6-Dec-23 20:55 
Questionhow to add another primary menu - C + in Qt Pin
Salvatore Terress1-Dec-23 7:34
Salvatore Terress1-Dec-23 7:34 
AnswerRe: how to add another primary menu - C + in Qt Pin
Andre Oosthuizen1-Dec-23 23:18
mveAndre Oosthuizen1-Dec-23 23:18 
GeneralRe: how to add another primary menu - C + in Qt Pin
Richard MacCutchan1-Dec-23 23:22
mveRichard MacCutchan1-Dec-23 23:22 
QuestionInvalidate rectangle Pin
Calin Negru1-Dec-23 1:41
Calin Negru1-Dec-23 1:41 
AnswerRe: Invalidate rectangle Pin
CPallini1-Dec-23 2:01
mveCPallini1-Dec-23 2:01 
GeneralRe: Invalidate rectangle Pin
Calin Negru1-Dec-23 2:40
Calin Negru1-Dec-23 2:40 
GeneralRe: Invalidate rectangle Pin
CPallini1-Dec-23 2:56
mveCPallini1-Dec-23 2:56 
AnswerRe: Invalidate rectangle Pin
Richard MacCutchan1-Dec-23 3:13
mveRichard MacCutchan1-Dec-23 3:13 

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.