#My code isnt working and i dont know how to solve it
18 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
Why code isnt working and i dont know how to solve it
My code isnt working and i dont know how to solve it
I think it’s because the array’s size needs to be known at compile time, not during run time. And user input is during run time so
Usually ppl just set the array to be big enough to whatever the biggest possible answer ur gonna get would be
The size 256 is common for a string I think
Use a vector
can i have an example of a vector use please?
std::vector<int> my_ints(3) if you want a vector of ints size 3
what if i want my vector to have the size of the integer that the users input?
std::vector<int> my_ints(whatever_var_you_stored_your_input_in)
int input;
std::cin >> input;
std::vector<int> my_vec(input);
for example
ah thank you!
@torn verge Has your question been resolved? If so, run !solved :)
!solved