POla
March 18th, 2008, 05:15 AM
I have seen a thread about IEnumerable here but that thread is resolved so I only open a new thread.
enum class Instruction{ sit, jog, walk};
ref class Pack{
Instruction halo;
List<Byte>^ result = gcnew List<Byte>();
result->AddRange(BitConverter::GetBytes(safe_cast<int>(halo));
};
error C2664:'System::Collections::Generic::List<t>::AddRange': cannot convert parameter 1 from 'cli::array <type>^' to 'System::Collections::Generic::IEnumerable<t>^'
It seem that i used the wrong type parameter although the bold code no problem in c#. I check and no see BitConverter in the IEnumerable type. what should i use instead? Thanks.
enum class Instruction{ sit, jog, walk};
ref class Pack{
Instruction halo;
List<Byte>^ result = gcnew List<Byte>();
result->AddRange(BitConverter::GetBytes(safe_cast<int>(halo));
};
error C2664:'System::Collections::Generic::List<t>::AddRange': cannot convert parameter 1 from 'cli::array <type>^' to 'System::Collections::Generic::IEnumerable<t>^'
It seem that i used the wrong type parameter although the bold code no problem in c#. I check and no see BitConverter in the IEnumerable type. what should i use instead? Thanks.