I need to create a simple linked list but can't even get the head pointer to initialize. I am pulling my hair out trying to figure out what I'm doing wrong. It may have something to do with the struct portion of my code. Any help would be much appreciated!
using namespace std;
struct Node// Should I have typedef struct Node?
new Node *pHead = NULL;//<-error in this line (";" expected before pHead)
pHead->data=7;//<-error in this line('pHead' undeclared, first use...)
cout << pHead->data;