My printInfo function is not printing out the information.
#include <iostream>
using namespace std;
struct book{
string title;
string author;
int publicationYear;
};
void getInfo(book);
void printInfo(book);
int main ()
{
book book1;
getInfo(book1);
printInfo(book1);
return 0;
}
void getInfo(book info)
{
cout << "What is the title of the book?" << endl;
cin >> info.title;
cout << "Who is the author of the book?" << endl;
cin >> info.author;
cout << "What is the publication year?" << endl;
cin >> info.publicationYear;
}
void printInfo(book printinfo)
{
cout << "The title is " << printinfo.title << ".\nThe author is " << printinfo.author << ".\nThe publication year is " << printinfo.publicationYear << endl;
}