0

How do i make up a code that stores up strings up to a limit defined by the user of the compiled cose

Arrays

24th Nov 2016, 2:07 PM
Daniel
Daniel - avatar
4 Réponses
+ 3
No problem! Just test the code if it works as you want it to and if I haven't missed anything ^^
24th Nov 2016, 3:03 PM
Zablas
Zablas - avatar
+ 2
#include <iostream> #include <string> using namespace std; int main() { int x=0; cout << "How many strings will you store?"; cin >> x; string strArr[x] = {}; for(int y = 0; y<x; y++) { cout << "Type in a string: "; cin >> strArr[y]; } return 0; }
24th Nov 2016, 2:58 PM
Zablas
Zablas - avatar
+ 1
thanks a lot.its nice communicating with u
24th Nov 2016, 3:01 PM
Daniel
Daniel - avatar
+ 1
I already have a prototype which I designed my self , I just wanted to be sure I was correct turned out I was. all thanks to you
24th Nov 2016, 3:05 PM
Daniel
Daniel - avatar