I have written the body of the function in the header file and so do not have a source file. when I tried running my project in visual studio .. I got an
error: Cannot open source file: No such file or directory.
How do I make visual studio understand that the definitions of the function are within the header itself?
You need to create a dummy source.cpp file just containing #include “source.h”
edit – I just tried this – Visual studio will let you do.
test.cpp
where test.h
Interesting – but pointless !