Error: conversion from `PriceFeed*' to non-scalar type `PriceFeed' requested

  • Thread starter axed
  • Start date
  • #1
2
0
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include <string>
using namespace std;

class PriceFeed
{
public:
PriceFeed(vector<string>& tickers)
{
// init(tickers);
}
}
int main ()
{
vector<string> tickers;
tickers.push_back("AAPL");
tickers.push_back("XOM");

//PriceFeed(tickers);
PriceFeed pf = new PriceFeed(tickers); // Error on this line
system("pause");
//return 0;
}

Can you please tell me where am i going wrong. This is the error
conversion from `PriceFeed*' to non-scalar type `PriceFeed' requested
 

Answers and Replies

  • #2
Borek
Mentor
28,502
2,916
new returns pointer.
 
  • #3
2
0
thanks a lot.
 

Related Threads on Error: conversion from `PriceFeed*' to non-scalar type `PriceFeed' requested

Replies
10
Views
7K
Replies
7
Views
20K
Replies
4
Views
3K
Replies
9
Views
2K
Replies
2
Views
558
Replies
1
Views
742
Replies
5
Views
11K
Top