CSV/C++ Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Laura Wilkinson
    New Member
    • Dec 2010
    • 17

    CSV/C++ Problem

    Hi all,

    I am having a problem where the user must enter the file which they would like to open, which displays information about vehicle details that have been stored as CSV.

    Code:
    NF39 FEO, Mr George Thomas, 29 Gillian Road, Safeways, Red, 5, 92, Normal Bus, -
    As the code below is in the main file, when I used include "CarC" infront of this information it was displayed;

    Code:
    //4 routines to create & populate various vehicles from csv string
    CarC* buildC(string dataLine);
    BusB* buildB(string dataLine);
    LorryL* buildL(string dataLine);
    MotorbikeM* buildM(string dataLine);
    
    //4 routines to display various vehicles on std::cout
    void displayC(CarC* cPtr);
    void displayB(BusB* bPtr);
    void displayL(LorryL* lPtr);
    void displayM(MotorbikeM* mPtr);
    But when the information is displayed on the screen, it includes "CarC" infront of the registration. Could any solve this mistery?

    Thanks in advance!
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    Debug your code, you might see exactly at what line it is making trouble.

    Besides this is not the code from where your mysterious problem can be solved

    Comment

    • Laura Wilkinson
      New Member
      • Dec 2010
      • 17

      #3
      The only thing that comes up is;

      "Vehicles.cpp(8 3) : warning C4018: '<' : signed/unsigned mismatch"

      For this code;

      Code:
      for (int i=0; i<numVehicles; ++i)

      Comment

      Working...