header files with different implementations

I'm a Java guy that is still learning some of the items with C++.

I'm designing my own board that will have an option of a wifi connection or a wired connection All for calling some simple restful web service.

I would like to define an interface (java term) or header file with different implementations of the code. For example, I would have a function/method to "callRestService(some parameters);

I would like to use a pragma statement (e.g. #ifdef) to link in one of the two implementations.

What is the best way to do this?

thx

//comment one
#define WIFI    0
#define WIRE   1

#ifdef WIFI 
#include <wifi.h>
#else
#include <wire.h>
#endif

something like this?

Be cautious, bubulindo. If your example both WIFI and WIRE are defined. You might mean:

#if WIFI 
  #include <wifi.h>
#else
  #include <wire.h>
#endif

this seems a bit strange to me. From what i'm seeing in the examples is TWO header files; each with a different impl. My question was to have 1 header file with different impl. In the Java world, this would be an interface, then typically a factory to load the correct impl at run-time. I was was hoping to do this at link time with C.

So if I'm reading this correct, I should just create different header files.

thx for the reply.

erg144:
In the Java world, this would be an interface, then typically a factory to load the correct impl at run-time.

From where?