No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
2 Posted Topics
[CODE]#include <iostream> #include <algorithm> #include <vector> #include <string> #include <ctime> #include <cstdlib> using namespace std; vector<string> function1(vector<string>v) { for(int i=0;i<4;i++) {cin>>v[i];} return v; } int main () {vector<string>v; vector<string>guess; vector<string>guess=function1(vector<string>v); cout<<"size:"<<guess.size()<<endl; cout<<"contents:"; for (int i=0; i<guess.size(); i++) {cout<<guess[i]<<"";} cout<<endl; return 0; }[/CODE] i need to build vector<string>guess(4) in function function1 … | |
i got difficulty here, i dont know how to create a random vector consist of 4 strings. using vector. [CODE]int main () { string red,yellow,blue,green; }[/CODE] i want to create random vector for those four colors. please help me.. -im a beginner for c++ |
The End.