Good evening,
I've been trying to write a linked list code for a while today, where I have two structs, one calling another. I also have a function, but attempting to pass the struct as an argument for the function returns an error.
The error reads as the title, saying that Node was not declared,
What gives?
(This is beginner level stuff, I am trying to make a simple linked list with data read from a file, but I did not reach that part of the code yet)
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
usingnamespace std;
struct Country {
string name;
double population;
};
struct Node {
Country ctry;
Node * next;
};
void push_front(double pop, string name, Node*& n, Node*& t); //Error here for both n and t
void push_front (double pop,string name, Node*& n, Node*& t)//Error here as well
{
// ...