c++ thing

closed account (28poGNh0)
when using the vector we can concatinate without specifying the size of the vector as shown in this exemple ,

1
2
3
4
5
6
7
8
9
10
11
# include <iostream>
# include <vector>
using namespace std;

int main()
{
    vector<char>myVect;
    myVect.push_back('j');
    myVect.push_back('k');
    cout << myVect.size() << endl;
}


That's exactly what I need ,but instead of entering letters I need to enter whole sentences,like this way twoDimArray[]vector;
like a two dimensional array,but without specify the size ,The bracktes are the lines and vector is the sentence I need to enter and when I need to call the 7th sentence I entered ,I can do cout << twoDimArray[6]vector ! this just a form

Thanks for reading ,any help ,could help your friend Techno01
closed account (zb0S216C)
You can use std::string with a std::vector, you know:

1
2
std::vector<std::string> adagio_for_strings;
adagio_for_strings.push_back("A string");

Wazzak
closed account (28poGNh0)
You diserve one million dolars
thanks a lot
Topic archived. No new replies allowed.