0

So I was trying to include the libraries I have declared in my main.cpp to my header.h

//In my main.cpp
#include <cmath>
#include <deque>
#include <vector>

using namespace std;


//In my header.h
#ifndef HANOI_H
#define HANOI_H

#include <cmath>
#include <deque>

using namespace std;



#endif

Would this check my main.cpp to see wether the 3 libraries and namespace exist with the corresponding variable HANOI_H?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Josh
  • 3,231
  • 8
  • 37
  • 58

1 Answers1

1

Yes because the #includes are performed which actually substitutes everything into 1 file. Therefore #ifndef never cares about multiple files or knows about them.

daniel gratzer
  • 52,833
  • 11
  • 94
  • 134