Documentation

    Table of Content
    • 3D File Formats
      • 3D File Formats
      • 3D2
      • 3DM
      • 3DS
      • 3MF
      • AMF
      • ASE
      • B3D
      • DAE
      • DRC
      • E57
      • FBX
      • GLB
      • GLTF
      • IPT
      • JT
      • MA
      • MB
      • MP
      • OBJ
      • PLY
      • PRC
      • RVM
      • STEP
      • STP
      • U3D
      • USD
      • USDZ
      • VRML
      • X
      • X3D
    • Audio File Formats
      • Audio File Formats
      • 8SVX
      • AA
      • AAC
      • AAX
      • AC3
      • ACT
      • AIFF
      • ALAC
      • AMR
      • APE
      • CDA
      • DSS
      • FLAC
      • GSM
      • M3U
      • M3U8
      • M4A
      • M4B
      • M4P
      • MID
      • MKA
      • MMF
      • MOD
      • MP2
      • MP3
      • MPC
      • MXL
      • NSA
      • OGG
      • OPUS
      • RA
      • RF64
      • SDT
      • STAP
      • VOC
      • VOX
      • VQF
      • WAV
      • WFP
      • WMA
      • WPL
      • WV
    • CAD File Formats
      • CAD File Formats
      • ART
      • ASC
      • ASM
      • CATPART
      • CF2
      • DC3
      • DGN
      • DST
      • DWF
      • DWFX
      • DWG
      • DWT
      • DXF
      • FZP
      • HPGL
      • IFC
      • IGES
      • IGS
      • JVSG
      • NC
      • NWC
      • NWD
      • NWF
      • PAT
      • PHJ
      • PLT
      • PSM
      • PSS
      • RFA
      • RFT
      • RML
      • RVT
      • SLDPRT
      • STL
    • Compression File Formats
      • Compression File Formats
      • 7Z
      • ACE
      • ALZ
      • APK
      • ARC
      • ARJ
      • B6Z
      • BKF
      • BZ2
      • DAA
      • DAR
      • DEB
      • DMG
      • DZ
      • FZPZ
      • GZ
      • ICE
      • ISO
      • KGB
      • LBR
      • LQR
      • LZ
      • LZ4
      • LZH
      • LZMA
      • LZO
      • LZX
      • MBW
      • MINT
      • MPKG
      • MPQ
      • NPK
      • OAR
      • PAGES
      • PEA
      • PET
      • PKG
      • PTK
      • PUP
      • RAR
      • RPM
      • RTE
      • SIFZ
      • SITX
      • SY_
      • TAR
      • TBZ
      • TGS
      • TGZ
      • TPSR
      • TZ
      • VPK
      • WUX
      • XAPK
      • XAR
      • XZ
      • Z
      • ZIM
      • ZIP
      • ZIPX
      • ZL
    • Database
      • Database File Formats
      • 4DB
      • 4DD
      • ACCDB
      • ACCDC
      • ACCDE
      • ACCDR
      • ACCDT
      • ACCDW
      • ACCFT
      • ADB
      • ADE
      • ADF
      • ADN
      • ADP
      • ALF
      • ANB
      • AQ
      • ASK
      • BAK
      • BCP
      • BTR
      • CDB
      • DACPAC
      • DAT
      • DB
      • DB3
      • DBC
      • DBF
      • DDL
      • DTSX
      • FMP12
      • FMPSL
      • FP5
      • FP7
      • GDB
      • ITW
      • LDF
      • LOG
      • MDB
      • MDF
      • MYI
      • NDF
      • NSF
      • SAV
      • SDF
      • SQL
      • SQLITE
      • TE
      • TRC
      • TRM
      • UDL
      • WDB
    • Disc and Media
      • Disc and Media File Formats
      • BIN
      • CCD
      • CSO
      • CUE
      • GADGET
      • IMG
      • NKIT
      • NRG
      • OVA
      • OVF
      • ROM
      • SDI
      • Toast
      • UDF
      • VCD
      • VDI
      • VHD
      • WBFS
      • WIM
      • WUD
    • EBook File Formats
      • EBook File Formats
      • ACSM
      • AEP
      • APNX
      • AVA
      • AZW
      • AZW1
      • AZW3
      • AZW4
      • BKK
      • BPNUEB
      • CBC
      • CBR
      • CBZ
      • CEB
      • CEBX
      • DNL
      • EA
      • EAL
      • EBK
      • EDN
      • EPUB
      • ETD
      • FB2
      • FKB
      • HAN
      • HTML0
      • HTMLZ
      • HTXT
      • HTZ4
      • HTZ5
      • IBOOKS
      • KFX
      • KOOB
      • LIT
      • LRF
      • LRS
      • LRX
      • MART
      • MBP
      • MOBI
      • NCX
      • NVA
      • OEB
      • OEBZIP
      • OPF
      • ORB
      • PHL
      • PML
      • PMLZ
      • POBI
      • QMK
      • RB
      • RZB
      • RZS
      • SNB
      • TCR
      • TK3
      • TPZ
      • TR
      • TR3
      • VBK
      • WEBZ
      • YBK
    • Email File Formats
      • Email File Formats
      • EDB
      • EML
      • EMLX
      • ICS
      • MBOX
      • MSG
      • OFT
      • OLM
      • OST
      • P7S
      • PST
      • RPMSG
      • TNEF
      • VCF
    • Executable
      • Executable File Formats
      • AHK
      • BAT
      • BTAPP
      • CGI
      • CMD
      • COM
      • EXE
      • IPA
      • MSI
      • MST
      • PIF
      • PYC
      • REG
      • WSF
      • WSH
      • XBE
      • XEX
    • Finance
      • Finance File Formats
      • ABA
      • IXBRL
      • XBRL
    • Font
      • Font File Formats
      • BDF
      • CFF
      • CFF2
      • EOT
      • FNT
      • FON
      • JFPROJ
      • MFX
      • OTF
      • PFA
      • PFB
      • PFM
      • SFD
      • TTC
      • TTF
      • Type1
      • WOFF
    • Game File Formats
      • Game File Formats
      • BMZ
      • BNS
      • CLIP
      • CSD
      • CT
      • DEK
      • FOMOD
      • GAM
      • KODU
      • MCWORLD
      • MGX
      • PAK
      • PCC
      • PSS
      • PUP
      • PWF
      • REL
      • REP
      • RPX
      • SAV
      • SFAR
      • SID
      • U8
      • UMX
      • W3N
    • GIS File Formats
      • GIS File Formats
      • 000
      • 3D
      • 3DD
      • ADF
      • APL
      • APR
      • ATX
      • AUX
      • DEM
      • DIV
      • DLG
      • E00
      • ETA
      • FileGDB
      • FIT
      • GeoJSON
      • GLB
      • GMAP
      • GML
      • GPKG
      • GPX
      • IMG
      • KML
      • KMZ
      • LOC
      • MPS
      • NM2
      • NTF
      • OSM
      • QGD
      • QGS
      • QGZ
      • QLR
      • QML
      • SBN
      • SHP
      • SHX
      • SP3
      • SSF
      • TCX
    • Image File Formats
      • Image File Formats
      • AI
      • APNG
      • ART
      • AVIF
      • BMP
      • BPG
      • CDR
      • CLIP
      • CMX
      • CPC
      • CR2
      • CR3
      • CSL
      • CT
      • CUR
      • DCM
      • DCR
      • DCX
      • DDS
      • DIB
      • DICOM
      • DJVU
      • DNG
      • ECW
      • EMF
      • EMZ
      • EXIF
      • FLIF
      • FODG
      • GBR
      • GIF
      • HEIC
      • HEIF
      • ICNS
      • ICO
      • J2C
      • J2K
      • JFIF
      • JP2
      • JPC
      • JPEG
      • JPF
      • JPM
      • JPX
      • JXR
      • MNG
      • MP
      • MPO
      • NEF
      • ODG
      • OTG
      • PCX
      • PNG
      • PPP
      • PSB
      • PSD
      • PSP
      • PSPIMAGE
      • SKP
      • SVGZ
      • TGA
      • THM
      • TIFF
      • WEBP
      • WMF
      • WMZ
      • XPM
      • XPR
    • Misc File Formats
      • Misc File Formats
      • AML
      • ART
      • CTG
      • ENL
      • ERR
      • GPG
      • H4
      • H5
      • ICA
      • KLQ
      • MD5
      • MSO
      • OBB
      • ODF
      • OGG
      • PES
      • RIS
      • RML
      • SSP
      • THM
      • TORRENT
      • VIM
      • VIMRC
      • XMP
      • XSMX
    • Note Taking File Formats
      • Note Taking File Formats
      • ONE
      • ONETOC2
    • Page Description Language
      • Page Description Language
      • CGM
      • EPS
      • INDD
      • INDT
      • OXPS
      • PCL
      • PS
      • SVG
      • SWF
      • TEX
      • XPS
      • XSLFO
    • PDF
      • PDF
      • FDF
      • PDF/A
      • PDF/E
      • PDF/UA
      • PDF/VT
      • PDF/X
      • XFDF
    • Presentation File Formats
      • Presentation File Formats
      • KEY
      • ODP
      • OTP
      • POT
      • POTM
      • POTX
      • PPS
      • PPSM
      • PPSX
      • PPT
      • PPTM
      • PPTX
    • Programming
      • Programming
      • ABC
      • ADDIN
      • AML
      • ANE
      • APA
      • APKS
      • APPX
      • APPXBUNDLE
      • APPXUPLOAD
      • APS
      • ARSC
      • AS
      • ASM
      • AWK
      • C
      • CD
      • Class
      • CMAKE
      • CONFIG
      • CPP
      • CS
      • CSPROJ
      • CXX
      • Dart
      • DIFF
      • EGG
      • ERB
      • G4
      • GO
      • GROOVY
      • H
      • HAML
      • HH
      • HS
      • HTA
      • ICI
      • IN
      • IPR
      • JAR
      • Java
      • JRXML
      • JSP
      • JSPF
      • KT
      • LGO
      • LUA
      • M
      • MAKE
      • MEL
      • MF
      • ML
      • MM
      • MRC
      • MSIX
      • NUPKG
      • NUT
      • PAS
      • PDB
      • PDE
      • PHP
      • PL
      • PY
      • PYD
      • PYI
      • PYM
      • PYW
      • PYX
      • R
      • RBXL
      • RBXM
      • RES
      • RS
      • RST
      • SCALA
      • SCM
      • SCRIPT
      • SH
      • SLN
      • SWIFT
      • TCL
      • TOML
      • TS
      • VB
      • VBPROJ
      • VBS
      • VCXPROJ
      • XSD
      • YAML
      • YML
      • YPR
    • Project Management File Formats
      • Project Management File Formats
      • MPP
      • MPT
      • MPX
      • P6XML
      • XER
    • Publisher File Formats
      • Publisher File Formats
      • PUB
      • PUZ
    • Reporting
      • Reporting File Formats
      • MAR
      • RDL
      • RDLC
      • RPL
      • RPT
    • Spreadsheet File Formats
      • Spreadsheet File Formats
      • 123
      • 12M
      • _XLS
      • _XLSX
      • AST
      • AWS
      • BKS
      • CELL
      • CSV
      • DEF
      • DEX
      • DFG
      • DIF
      • DIS
      • EFU
      • ESS
      • FCS
      • FM
      • FODS
      • FP
      • GNM
      • GNUMERIC
      • IMP
      • MAR
      • NB
      • NUMBERS
      • NUMBERS-TEF
      • ODS
      • OTS
      • PMD
      • PMDX
      • PMVX
      • SDC
      • STC
      • SXC
      • TMV
      • TMVT
      • TSV
      • XAR
      • XL
      • XLA
      • XLAM
      • XLM
      • XLR
      • XLS
      • XLSB
      • XLSM
      • XLSMHTML
      • XLSX
      • XLT
      • XLTHTML
      • XLTM
      • XLTX
    • System File Formats
      • System File Formats
      • AML
      • ASV
      • CAB
      • CFG
      • CPL
      • DLL
      • DMP
      • DRV
      • ETL
      • INI
      • INS
      • LNK
      • SCR
      • SYS
      • TMP
    • Video File Formats
      • Video File Formats
      • 3G2
      • 3GP
      • AMV
      • ARF
      • ASF
      • AVCHD
      • AVI
      • BIK
      • DAV
      • EXO
      • F4V
      • FLV
      • H264
      • H265
      • M2TS
      • M4V
      • MJPEG
      • MK3D
      • MKS
      • MKV
      • MOV
      • MP4
      • MPE
      • MPG
      • MPV
      • MTS
      • MXF
      • NSV
      • QT
      • RM
      • RMVB
      • RV
      • SEC
      • SRT
      • TS
      • VID
      • VOB
      • VP6
      • VP8
      • VP9
      • VTT
      • WEBM
      • WMV
      • XVID
    • Web File Formats
      • Web File Formats
      • A5W
      • AAE
      • ADR
      • AEX
      • ALX
      • AN
      • APKG
      • ARO
      • ASA
      • ASAX
      • ASCX
      • ASHX
      • ASMX
      • ASP
      • ASPX
      • BML
      • CDF
      • CER
      • CFM
      • CFML
      • CHM
      • CODASITE
      • CRDOWNLOAD
      • CRT
      • CSHTML
      • CSS
      • DAP
      • DBM
      • DHTML
      • DML
      • DOCHTML
      • DRAWIO
      • DWT
      • EDGE
      • FMP
      • FWP
      • FWTEMPLATE
      • GDOC
      • GDOCX
      • HAR
      • HDML
      • HTM
      • HTML
      • JHTML
      • JS
      • JSON
      • JSPA
      • LESS
      • MHT
      • MHTML
      • MJS
      • OBML
      • OBML15
      • OBML16
      • P7B
      • P7C
      • PAC
      • PART
      • RHTML
      • RJS
      • RSS
      • Sass
      • SCSS
      • SHTML
      • SPC
      • SSP
      • STC
      • STML
      • TPL
      • TS
      • URL
      • VDW
      • VRT
      • WBS
      • WEBBOOKMARK
      • WEBLOC
      • WEBSITE
      • WHTT
      • WSDL
      • XAML
      • XD
      • XHT
      • XHTML
      • XML
      • XOJ
      • XOML
      • XSLT
      • XUL
      • ZUL
    • Word Processing File Formats
      • Word Processing File Formats
      • ASD
      • DOC
      • DOCM
      • DOCX
      • DOT
      • DOTM
      • DOTX
      • DSC
      • FAQ
      • FODT
      • IPYNB
      • LATEX
      • LTX
      • MAN
      • MD
      • ODM
      • ODT
      • OTT
      • QBL
      • QPF
      • RTF
      • TXT
      • WPD
      • WPS
    • visio
      • Visio File Formats
      • VDW
      • VDX
      • VSD
      • VSDM
      • VSDX
      • VSS
      • VSSM
      • VSSX
      • VST
      • VSTM
      • VSTX
      • VSX
      • VTX
    1. Home
    2. Programming
    3. HH

    What's on this Page

      • What is an HH file?
      • .HH File Format
      • Difference Between .H and .HH Files
        • Header Guards
      • References

    What is an HH file?

    A file with .hh extension is a C++ header file that includes the declaration of variables, constants, and functions. These declarations are used by the corresponding C++ implementation files, usually saved as .cpp files that contain the actual implementation of user logic. The .hh header files are referenced in the implementation CPP files using the #include directive. You can add as many as possible header files to your C++ project to include project level declarations.

    .HH File Format

    A .hh file is a plain text file that is created keeping in view the header file definition rules. Most common information declared in a .hh file include the following.

    Variables - In case of Object Oriented Programming (OOP), a class header file contains definitions of all class level variables that are accessible across the implementation source code files Methods Declaration - All the methods declarations are included in the .h header files to be accessible across multiple implementation files. Non-Inline Function Definitions - Header files can also contain definitions of a non-inline methods. Message Maps - A header file can also contain message maps in case of an MFC source code implementation. In such case, the message maps are linked to the functionality implementation which is linked to UI elements such as button, checkbox, radio buttons, etc.

    Difference Between .H and .HH Files

    Apparently, there is no such difference between the .h and .hh header files other than the recommended way of using these for respective languages i.e. C or C++. Naming your header files according to these languages help you distinguish between these in a large project that can be a mix of C and C++ implementations.

    In addition, if the headers are separated by extension, your editor can apply the appropriate formatting automatically for respectively.

    Overall, the differentiation of these two file formats will not do any harm, but will be advantageous, and is encouraged to follow for C and C++ distinction.

    Header Guards

    Header files can raise to complex errors where multiple declarations are included in the same file as a result of adding other header files. This duplicate definitions raise compiler errors. This problematic situation can be avoided via a mechanism called header guard that are conditional compilation directives as shown below.

    #ifndef ANY_UNIQUE_NAME_HERE_HPP
    #define ANY_UNIQUE_NAME_HERE_HPP
    
    // your declarations (and certain types of definitions) here
    
    #endif
    

    With this header, the preprocessor checks whether the ANY_UNIQUE_NAME_HERE_HPP has already been defined. If the header is repeatedly included into the same file, the contents of the header will be ignored.

    References

    • Header Filers - Microsoft
    • Difference between .h and .hh file formats

    See Also

    • KT File Format
    • AVIF File Format
    • RA File Format
    • XLAM File Format
    • H - C/C++ Header File Format