Top "Header-files" questions

Header files are used in some programming languages to hold source code as a single copy that may be reused in multiple source files.

Is is a good practice to put the definition of C++ classes into the header file?

When we design classes in Java, Vala, or C# we put the definition and declaration in the same source file. …

c++ declaration definition header-files
Include in header file vs. forward-declare and include in .cpp

I have a class B, and I want to call members form class A. So: 1. //A.h class B; class …

c++ header-files
Difference between cuda.h, cuda_runtime.h, cuda_runtime_api.h

I'm starting to program with CUDA, and in some examples I find the include files cuda.h, cuda_runtime.h …

cuda header-files
Should I define static inline methods in header file?

I've read about how it is usually best not to define anything in header files because redundant copies are made …

c++ static inline header-files
multiple definition error c++

My 'Headers.h' file includes basic c++ Headers #include <iostream> #include <cstring> // and many header files. …

c++ header-files multiple-definition-error
Where can I find the implementation of stdio.h in Visual Studio?

I could find stdio.h header file easily through search in Windows Explorer, but couldn't find its implementation file like …

visual-studio header-files stdio
Header files inclusion / Forward declaration

In my C++ project when do I have to use inclusion (#include "myclass.h") of header files? And when do …

c++ header-files forward-declaration
include stdafx.h in header or source file?

I have a header file called stdafx.h and this one is precompiled of course. I've read that I should …

c++ visual-studio header-files precompiled-headers stdafx.h
ISO C++ forbids declaration of ... with no type

I'm using C++ to make a Qt mobile application for maemo. I have my class declaration, but I get this …

c++ qt header-files maemo qt-mobility