G
Guest
Hi.
I heard that vs2005 vc++ support the "for each" statement.
I try it in vs2005 by creating a dotnet c++ console program.
The code is:
#using <System.dll>
using namespace System;
using namespace stdcli::language;
void main(){
array<int>^ ary1 = gcnew array<int>(4){1,2,3,4};
for each(int i in ary1)
Console::WriteLine(i);
}
But the compiler told me:
error C2061: syntax error : identifier 'each'
Is that error in my code? or the beta version doesn't support "for each"??
I heard that vs2005 vc++ support the "for each" statement.
I try it in vs2005 by creating a dotnet c++ console program.
The code is:
#using <System.dll>
using namespace System;
using namespace stdcli::language;
void main(){
array<int>^ ary1 = gcnew array<int>(4){1,2,3,4};
for each(int i in ary1)
Console::WriteLine(i);
}
But the compiler told me:
error C2061: syntax error : identifier 'each'
Is that error in my code? or the beta version doesn't support "for each"??