Answer the question
In order to leave comments, you need to log in
How to fill an array in C++/CLI?
I've just started learning C++/CLI, so I don't fully understand the input methods.
Let's say I create an array. How can I fill it out? The code below fills an array with obscure values.
#include "pch.h"
using namespace System;
int main(array<System::String ^> ^args)
{
array<int>^ M = gcnew array <int>(7);
Console::Write(L"Массив М(7): ");
for (int i = 0; i < M->Length; i++)
{
M[i] = Convert::ToInt32(Console::Read());
}
for (int i = 0; i < 7; i++)
Console::Write(L"{0} ", M[i]);
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question