I want to declare my linked list as external in my header file..so that my head and current pointers are globals..i have done something like this but i dont know where the problem is..i want the values of head and current to be initialized and used by all the other fuctions without re-declaring them or re-initializing them...the code below compiles but current and head are not initialized..
#include<fstream>
using namespace std;
struct myStruct
{
string name;
double number;
myStruct* link;
};
typedef myStruct* nodePtr;
extern nodePtr head;
extern nodePtr current;
void new_details(nodePtr& head, nodePtr& current);
void add_details(nodePtr& head ,nodePtr& current);
#endif