I saw many, many solutions to that problem yet none of them seem to work in my case.
<pre>#include <iostream>
#include <string>
#include <iostream>
#include <fstream>
#include <unordered_map>
using std::string;
Node* GetNewNode(string indeks, string atrybut, string oper, double wartosc, string indeks_NIE, string indeks_TAK, string komentarz);
class Node
{
public:
std::string indeks;
std::string atrybut;
std::string oper;
double wartosc;
std::string ind_NIE;
std::string ind_TAK;
std::string komentarz;
Node* left;
Node* right;
};
int main()
{
GetNewNode("a", "b", "c", 23.4, "d", "e", "f");
};
Node* GetNewNode(std::string indeks, std::string atrybut, std::string oper, double wartosc, std::string indeks_NIE, std::string indeks_TAK, std::string komentarz) {
Node* newNode = new Node();
newNode->indeks = indeks;
newNode->atrybut = atrybut;
newNode->oper = oper;
newNode->wartosc = wartosc;
newNode->ind_NIE = indeks_NIE;
newNode->ind_TAK = indeks_TAK;
newNode->komentarz = komentarz;
newNode->left = newNode->right = NULL;
return newNode;
};
This is just a part of a slightly bigger project, it however has left me scratching my head.
The errors are:
missing type specifier - int assumed. note c++ does not support default-int
times 2 for the line:
Node* GetNewNode(string indeks, string atrybut, string oper, double wartosc, string indeks_NIE, string indeks_TAK, string komentarz);
and times 2 for the line:
Node* GetNewNode(std::string indeks, std::string atrybut, std::string oper, double wartosc, std::string indeks_NIE, std::string indeks_TAK, std::string komentarz) {
The previous ones are my main problems, the others listed below arent there for the complete project.
'int Node':redefinition
Im working in Visual Studio
What I have tried:
checked about 2000 times if
#include <string>
was there,
watched a tutorial on youtube on creating BSTs while following them,
adding
return 0;
to the main function