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
    PriceFeed(vector<string>& tickers)
    // init(tickers);
    int main ()
    vector<string> tickers;

    PriceFeed pf = new PriceFeed(tickers); // Error on this line
    //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


    User Avatar

    Staff: Mentor

    new returns pointer.
  4. Oct 11, 2009 #3
    thanks a lot.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook