/******header file*****/
namespace graph{
void dfs(...);
};
/******cpp file******/
#include "graph.h"
using namespace graph;
void dfs(...){
//some code here
//dfs(...); <-- wrong
//graph::dfs(...); <-- it was fine,until i call the function from main.cpp
}
When i define the recursive function in the implementation file, it gives me error on the recursive call line. If i change it to "graph::dfs(...)", it doesn't give me error but if i call the function from main.cpp, it still gives me error. If i don't use the "using namespace graph" and call them like "graph::dfs", it doesn't give me error. But why ?