I'm a bit of a newbie in C++ and recently stumbled upon a question I've not really found a decent answer too. What I'm trying to do is create a string array and then usinguse a pointer to modify it. I'm not quite sure how to declare the pointer since strings can vary in length, and I think this is what causes the error.
What I have so far isMy code looks something like this (Just cut out the important bits, if u want all source tell me and I'll edit it in):
#includes <string>
#includes <iostream>
using namespace std;
string *users = NULL;
int seatNum = NULL;
cin >> seatNum;
users = new string[seatNum];
string name;
cin >> name;
users[seatNum] = name;
It throws me an Write Access Violation when I try to change its value. From what I've read it's because strings are compiled as read-only, so my question is how would I/what would I do to change it? An "easy to understand" explanationEasy-to-understand explanations would be preferable as I'm not comfortable with C++ at the moment.