#Where to put the header files

6 messages · Page 1 of 1 (latest)

gentle igloo
#

Which of the following is correct:

#define _CRT_SECURE_NO_WARNINGS

#ifndef HEADER_FILE
#define HEADER_FILE

#include <iostream>
#include <string>

// ....

#endif
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>

#ifndef HEADER_FILE
#define HEADER_FILE

// ....

#endif
wind sparrowBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

ivory summit
#
#ifndef HEADER_FILE
#define HEADER_FILE

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>

// ....

#endif

the header guards should be the first thing in the file

wind sparrowBOT
#

@gentle igloo Has your question been resolved? If so, type !solved :)

gentle igloo
#

!solved