python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Transferring an ifstream into an unordered map of a string and vector of strings
int main() {
std::unordered_map<std::string, vector<std::string>> pronunciation_dict;
std::vector<std::string> phonomes;
std::string pronun;
{
std::ifstream pronun_file(&...

Drake Goldsmith
Votes: 0
Answers: 1
Find index of vector element using search_n function
I need to find index of vector element using a function from algorithm library.
EXAMPLE:
{1,2,3,4,5,6,7,8,9,10}
Element 5 found at 5 position.
#include <algorithm>
#include <iostream>
#inc...

user18476780
Votes: 0
Answers: 1
sorting vector leads to vector subscript out of range
I'm trying to sort the elements in a vector from smallest to biggest.
My algorithm:
Find the smallest number in the vector using least()
Find all occurrences of the smallest number in the vector and ...
Benjamin Chen
Votes: 0
Answers: 0
Faster way of loading (big) std::vector<std::vector<float>> from file
I have implemented a way to save a std::vector of vectors to file and read them using this code (found here on stackoverflow):
Saving:
void saveData(std::string path)
{
std::ofstream FILE(path, st...
Paul Aner
Votes: 0
Answers: 3