0

I have one .h file, one .cpp file and one main.cpp file.

a.h

class abc {
      abc();
      ~abc();
      void dispaly();
};

implementation.cpp

#include "a.h"
void abc::dispaly()
{
 cout << "inside .cpp file";
}

main.cpp

#include<a.h>
#include<iostream>
int main()
{
  abc obj;
  obj.dispaly();
}

Now this program executes properly without any errors(Ignore syntax errors if any). In the main program i only included "a.h" file and not included "implementation.cpp". i don't understand how the implementation.cpp file is linked to the header file and main.cpp file?

rici
  • 234,347
  • 28
  • 237
  • 341
Hemanth
  • 1
  • 1
  • 1
  • 4

0 Answers0