I have a very long script with many function and global parameters, I wish to work with three separate files: main script, functions and parameters.
I've seen lately someone includes a global variable file into a cpp script without header files. All the answer here show how to do it with a .cpp and .h file, something I find to be cumbersome. Is there a way to make this simple example work using a single file?
// param.cpp - global parameters separate file
double a=1.7;
double g=8/2;
// main.cpp - main script file
#include <iostream>
#include <math.h>
#include "param.cpp"
using namespace std;
int main()
{
double d = a+g;
return 0;
}