Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

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

  1. Oct 10, 2009 #1
    #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
     
  2. jcsd
  3. Oct 11, 2009 #2

    Borek

    User Avatar

    Staff: Mentor

    new returns pointer.
     
  4. Oct 11, 2009 #3
    thanks a lot.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Error: conversion from `PriceFeed*' to non-scalar type `PriceFeed' requested
Loading...