w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
c++ reading in text file into vector then writing to vector or array depending on first word in internal vector

There are a lot of compile errors produced by your program. I suggest you to give some more time in reading the basics of C++ and STL.

  1. std::vector<std::vector<std::string>> values; to std::vector<std::vector<std::string> > values;. Notice the difference, some C++ compilers will take >> as the right shift operator.

  2. In many places in your code, you've used just vector instead of std::vector. Correct this or consider adding using namespace std; before the main function.

  3. double is a primitive type. There is nothing called std::double.

  4. Change vector::size(values)-1 to values.size() - 1.

  5. Use ; instead of , to separate the three parts of the for statement.

  6. switch values[i][0] it should be switch (values[i][0]).

  7. E3T is a string, so you use "E3T" instead of 'E3T'. Single quote is for characters.

  8. And C++ doesn't support switch with strings, so use if-else-if instead.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.