I been searching a lot lately about header files and stuff and i always see the same things, but i dont get something, why use the .h header file when you can just throw the code on the .cpp file?
Why do this?:
//getten.h
#pragma once
int GetTen();
//getten.cpp
#include getten.h
int GetTen(){ return 10; }
//main.cpp
#include "getten.h"
printf(GetTen());
When you can do:
//getten.cpp
int GetTen(){ return 10; }
//main.cpp
#include "getten.cpp"
printf(GetTen());