Is there a good way for my header class to choose which .cpp file he can call at runtime?
For example :
a.h
#pragma once
#include <iostream>
class a
{
public:
a() {};
void printA();
};
a.cpp :
#include "a.h"
void a::printA()
{
std::cout << "first";
}
a_mockup.cpp :
#include "a.h"
void a::printA()
{
std::cout << "second";
}
Then in main I want to choose which one I want to call:
main.cpp:
#include "a.h"
#include <string.h>
using namespace std;
int main()
{
a test;
test.printA();
}