So I have been getting an error with this struct I am trying to create and use. The struct using char's instead of strings worked, but I found that I am going to need to be able to store many letters. Upon using this small sample of code below I get this error:
error: member ‘std::__cxx11::string GraphNode::::c1’ with constructor not allowed in anonymous aggregate string c1;
#include <iostream>
#include <cstdlib>
#include <fstream>
#include <functional>
#include <queue>
#include <vector>
#include <string>
#include <map>
using namespace std;
class Node
{
public:
struct
{
string info;
Node *next;
int weight;
bool activated;
};
};
My more dubbed down question would be, can strings not be used in structs? Is there a different way to declare this or another work around?