void incrementData()
{
data++;
}
and this function in my DLList classvoid process(void (*f)())
{
for(DLNode<DATA>* temp = head; temp != NULL; temp = temp->getNext() )
{
temp->f();
}
}
I'm having scope issues, this is where i try to use it.(in main)
DLList<int> DLL;
DLL.pushBack(1);
DLL.pushBack(2);
DLL.pushBack(3);
DLL.pushBack(4);
cout << DLL << endl;
DLL.process(incrementData);
cout << DLL << endl;
error: 'incrementData' was not declared in this scope|
Is incrementData part of DLList class? If yes than you have to call is using the object.
If that's a global function, its declaration should be inside a header file.
otherwise if you don't have a header file, it should be defined at the top of the .cpp file.
Its part of my node class since that's where the data member 'data' is stored. My dllist and
dlnode classes are bother h files only. Trying to avoid problems with cross platform compilation