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.

Makefile, header dependencies

Let's say I have a makefile with the rule %.o: %.c gcc -Wall -Iinclude ... I want *.o to be rebuilt …

dependencies makefile header-files
Invalid Operands to binary / (have 'int *' and 'int')?

Every time I try this: long crypt(int *integer) { printf("Enter five digit integer:\n"); scanf("%i",integer); int digit1=…

c header-files operands
How can a C++ header file include implementation?

Ok, not a C/C++ expert by any means, but I thought the point of a header file was to …

c++ header-files
Default member values best practice

Is it good practice when writing C++11 code to set default values for class members in the header file of …

c++ constructor c++11 header-files default-value
Is it a good practice to define C++ functions inside header files?

I'm wondering if it's a good practice to store C++ regular functions, not methods(the ones in classes) inside header …

c++ function header-files
What should go into an .h file?

When dividing your code up into multiple files just what exactly should go into an .h file and what should …

c++ header-files
"using namespace" in c++ headers

In all our c++ courses, all the teachers always put using namespace std; right after the #includes in their .h …

c++ namespaces header-files
How to create two classes in C++ which use each other as data?

I'm looking to create two classes, each of which contains an object of the other class type. How can I …

c++ class pointers header-files
Error "C++ requires a type specifier for all declarations whilst defining methods"

I'm relatively new to C++ (so try and keep answers simple please!), and I can't understand why I get the …

c++ class oop header-files