| | |
vector of strings error
Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2008
Posts: 160
Reputation:
Solved Threads: 3
When i compile this code i get an error which states
main.cpp|38|error: no match for call to ‘(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) (long int&)’|
I am going to assume that this is something to do with trying to put the string in a different kind of string, so how should I fix this error, thanks in advance.
main.cpp|38|error: no match for call to ‘(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) (long int&)’|
I am going to assume that this is something to do with trying to put the string in a different kind of string, so how should I fix this error, thanks in advance.
C++ Syntax (Toggle Plain Text)
#include <iostream> #include <fstream> #include <vector> using namespace std; int main() { string LogicMolecule; string ExecutableCodeName; string LogicMoleculeFileName; vector<string> LogicMolecules; long index; cout << "Execute: "; cin >> ExecutableCodeName; ExecutableCodeName = ExecutableCodeName + ".code"; ifstream ExecutableCodeFile; ExecutableCodeFile.open(ExecutableCodeName.c_str()); if (!ExecutableCodeFile.is_open()) { cout << "\n"; cout << "error: can't open "; cout << ExecutableCodeName; } while (ExecutableCodeFile >> LogicMolecule) { LogicMolecules.push_back(LogicMolecule); } ExecutableCodeFile.close(); index = 0; LogicMoleculeFileName = LogicMolecules(index) + ".logic molecule"; ifstream LogicMoleculeFile; LogicMoleculeFile.open(LogicMoleculeFileName.c_str()); if (!LogicMoleculeFile.is_open()) { cout << "\n"; cout << "error: can't open "; cout << LogicMoleculeFileName; } }
![]() |
Similar Threads
- vector of strings to chars (C++)
- Strings from file (C++)
- Error (C)
- Vector of strings (warnings) ? ? (C++)
- Multimap confusion; how does it work? (C)
- Error reading in file in binary mode (C++)
- Duplication (C++)
Other Threads in the C++ Forum
- Previous Thread: Settings in Application (C++)
- Next Thread: program wont pause
Views: 320 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api array arrays based beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete deploy dll download dynamic encryption error file forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library lines linkedlist linker list loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference return simple sort spoonfeeding stream string strings struct temperature template templates test text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






