I have a class and I've instantiated the variable I was going to use for the getline but when I run it the line is completely skipped for some reason.
Up in the constructor:
Address::Address()
{
cAddress = new char [ARYA];
//Other stuff too but this is the main issue.
}
Code in function:
void Address::GetAddress()
{
cout<<"Your address: ";
cin.getline(cAddress, ARYA,'.');
//Will end after they enter a period.
}
Can you help me with this? I've tried multiple things but this function just keeps getting skipped over. Like the cout will be displayed but no input is "allowed"; the next function is called and its cout information is displayed where the cin is supposed to be for the GetAddress() function.
Up in the constructor:
Address::Address()
{
cAddress = new char [ARYA];
//Other stuff too but this is the main issue.
}
Code in function:
void Address::GetAddress()
{
cout<<"Your address: ";
cin.getline(cAddress, ARYA,'.');
//Will end after they enter a period.
}
Can you help me with this? I've tried multiple things but this function just keeps getting skipped over. Like the cout will be displayed but no input is "allowed"; the next function is called and its cout information is displayed where the cin is supposed to be for the GetAddress() function.