Hello I am having trouble with the getline() function in C++ I am new to C++ and relatively new to programming period. I am in an intro to C++ course and my research that I have done on this topic myself online has not led me to a solution I do not really understand all the things that they speak about as this is the very first assignment in my class. Any quick/rough help/understanding would be greatly appreciated as we will cover this topic in class more thoroughly. Below is the code that I am writing. It is a simple program that just asks users for name and address and then displays that info in correct mailing format.
#include <iostream>
#include <string>
int main()
{
// Variables for Mailing Addresses
std::string firstName;
std::string lastName;
int houseNum;
std::string streetName;
std::string cityName;
std::string state;
int zipCode;
// Asking for input
std::cout << "What is your First name?: ";
std::cin >> firstName;"\n";
std::cout << "What is your Last name?: ";
std::cin >> lastName;"\n";
std::cout << "What is your House Number?: ";
std::cin >> houseNum;"\n";
std::cout << "What is your Street Name?: ";
std::getline(std::cin,houseNum);
return 0;
}
The error code thats thrown is "No matching function for call to 'getline'".