I canโt get rid of these errors ... I have a semicolon that I checked ... the code is simple: the error leads me to the definition of "string name" in the .h article ...
main.cpp
#include <iostream> #include <fstream> #include <vector> #include <string> using namespace std; #include "article.h" int main() { string si; char article[128]; vector<Article> articles; ifstream file; file.open("input.txt",ifstream::in); while(!file.eof()) { file.getline(article,128); articles.push_back(Article(article)); } file.close(); while(1); return(1); }
article.h:
#ifndef Article_H #define Article_H class Article { public: int year; string name; Article(char *i_name); }; #endif
c ++
kaycee
source share