Ok I've been looking everywhere and I can't find the proper way to do this. I simply want to take in a string, put that string in the array and output the contents. However, I want to do it dependent on the size of the string which the user enters in. And I was getting weird errors such as incompatibility and I would like to know why please, thank you.
#include <iostream>
#include <array>
#include <string>
using namespace std;
int main()
{
int x = 4000;
string y;
cout << "Enter value";
getline(cin, y);
array<char, strlen(y)>state;
for(int i=0; i<strlen(y); ++i)
cout << state[i] << ' ';
system("PAUSE");
return 0;
}
i hope it will work..