#Visual Studio Issue(I'm not sure myself)
20 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 use !howto ask.
@slow radish
Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!
Variable length arrays are a (cursed) gcc extension and are not valid C++
You should be using a vector, or a fixed sized array
My homework asks for it to be variable, so I'm unsure what to do now.
I'm supposed to build an array
a vector is dynamically sized
if you're not allowed to use them, you'll have to heap allocate it with new[] and delete[]
I'll be honest, I am very much confused by what you're telling me.
you cannot do ```cpp
int n;
std::cin >> n;
int a[n];
in C++, it isn't valid
so you need to do it another way. Have you seen vectors or manual memory management?
Yes, I did learn about vectors.
that's what you need to use instead
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity
you're welcome, good luck 