using user input for an array

In my main.cpp, I get the user's input and then I pass the user's input over to entrylist.cpp for storing the input into the list of entries. I do not know how to get the input in the main function then manage it in the entrylist.cpp file

In main.cpp i have this function to get the input
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  void AddInput(Entrylist& p1)
{
   Entry e;

cout << "Entry title: ";
cin.getline(title, 30); //error here, undeclared identifier. title is part of //entry.h and entry.cpp

cout << "Entry author: ";
cin.getline(author, 20) //same error as above

cout << "Entry category: ";
cin.get(); 

p1.Add(s);
}


The Add function in entrylist.cpp looks like:
1
2
3
4
5
6
7
8
9

void Entrylist::Add(Entry& e)
{

this->Resize(true);
entryList[currentSize] = e;
currentSize++;

}


This code does not work , but how could I do it without doing operator overloading for >> ?
Last edited on
Topic archived. No new replies allowed.