This is my code:
#include <iostream>
#include <string>
#include <bits/stdc++.h>
using namespace std;
int main()
{
string word = "hi";
int i = 0;
vector<string> vec;
for(i ; i < word.length() ; i++)
{
vec.push_back(word[i]);
}
return 0;
}
I am trying to push each letter of string "hi" into a vector vec using for loop, but, it is throwing an error on the 14th line: "error: no matching function for call to ‘std::vector >::push_back(char&)’"