Answer the question
In order to leave comments, you need to log in
Dynamic string array using string, what's the problem?
#include <iostream>
#include <string>
using namespace std;
int i = 2;
string *a = new string[i];
int main()
{
a[0] = "abc";
a[1] = "del";
i++;
a[2] = "monday";
cin.get(); cin.get();
delete [] a;
return 0;
};
Answer the question
In order to leave comments, you need to log in
Honestly, the problem is your stupidity.
To get started, read the book. Everything is simple and easy there. Many questions will disappear by themselves.
PS By changing the variable i you will not change the size of the array s.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question