PDA

View Full Version : error: conversion from `PriceFeed*' to non-scalar type `PriceFeed' requested


axed
Oct10-09, 08:43 PM
#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

Borek
Oct11-09, 05:16 AM
new returns pointer.

axed
Oct11-09, 06:17 AM
thanks a lot.