I have the following code
#include <iostream>
#include<string>
#include <sstream>
using namespace std;
struct product{
int weight;
float price;
};
int main(){
string mystr;
product prod;
product *pointer;
pointer=∏
getline(cin,pointer->price);
return 0;
}
but it shows me the mistake
no instance of overloaded function “getline” matches argument list
What is the mistake?
The mistake is that getline returns string, not float.