Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. pragma once

pragma once

Scheduled Pinned Locked Moved C / C++ / MFC
csharpvisual-studioquestion
3 Posts 3 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John theKing
    wrote on last edited by
    #1

    Hi !! What is the meaning of following statements: #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 generated by visual studio in header files.

    T P 2 Replies Last reply
    0
    • J John theKing

      Hi !! What is the meaning of following statements: #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 generated by visual studio in header files.

      T Offline
      T Offline
      Taka Muraoka
      wrote on last edited by
      #2

      It tells the compiler to only process the header file once.


      Software is everything. It also sucks. Charles Fishman [^] Awasu 1.0.3 (beta)[^]: A free RSS reader with support for Code Project.

      1 Reply Last reply
      0
      • J John theKing

        Hi !! What is the meaning of following statements: #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 generated by visual studio in header files.

        P Offline
        P Offline
        peterchen
        wrote on last edited by
        #3

        As Taka said, it tells the compiler to process the header file only once (unlike the usual #ifndef _HEADERNAME #define _HEADERNAME ..., it doesn't need to open the file again, start parsing etc.) It's implemented only in certain compiler versions, for which is the additional #ifdef _MSC_VER check


        "Der Geist des Kriegers ist erwacht / Ich hab die Macht" StS
        sighist | Agile Programming | doxygen

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups