What is the purpose of this line in a header file?

Advertisement

#pragma once

  • to restrict the use of its contents to only one source file
  • to tell the compiler that only one variable can be instantiated from the classes or types contained in this header file
  • to help the compiler finish faster by assuring that only one compiler pass is neccessary for the code included in this header file
  • to make the compiler parse that header file only once, even if it is included multiple times in the source
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend