question

JohnCTX-6479 avatar image
0 Votes"
JohnCTX-6479 asked JeanineZhang-MSFT commented

How to create header files for later usage?

I want to create header files, but I do not know where to begin.

Which reserved keywords start and end within a header file?

Its purpose is to write my own specialized file permissions, even though, I do not need to use the DWORD Windows registry keyword.

c++
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Castorix31 avatar image
0 Votes"
Castorix31 answered
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JeanineZhang-MSFT avatar image
0 Votes"
JeanineZhang-MSFT answered JeanineZhang-MSFT commented

Hi,

I want to create header files, but I do not know where to begin.

You could start from an empty project, and then add a .h file (right click the project -> add -> New Item).

121028-image.png

121076-image.png

Which reserved keywords start and end within a header file?

Typically, header files have an include guard or a #pragma once directive to ensure that they are not inserted multiple times into a single .cpp file.

 #ifndef YOUR_NAME_INCLUDE
 #define YOUR_NAME_INCLUDE
    
 /* Your function statement here */
 #endif

For more details about header files, I suggest you could refer to the Doc: https://docs.microsoft.com/en-us/cpp/cpp/header-files-cpp?view=msvc-160


Best Regards,

Jeanine


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



image.png (36.6 KiB)
image.png (32.0 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@JohnCTX-6479

May I know if you have got any chance to check my answer? I am glad to help if you have any other questions.

0 Votes 0 ·