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
4 odpowiedzi
+ 3
No problem! Just test the code if it works as you want it to and if I haven't missed anything ^^
+ 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;
}
+ 1
thanks a lot.its nice communicating with u
+ 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