http://msdn2.microsoft.com/zh-cn/library/a9z6549f(VS.80).aspx
msdn上有段代码,在vc 7.0下不能通过编译.那为啥vc7.0又称为vc.net 2003呢?
------解决方案--------------------------------------------------------
2003应该是vc7.1
------解决方案--------------------------------------------------------
看了你的网址,它使用clr/c++的语法,应该是vs.net 2005 下用的
try
using namespace System;
using namespace System::Text::RegularExpressions;
int main( )
{
int words = 0;
String* pattern = S "[a-zA-Z]* ";
Console::WriteLine( S "pattern : '{0} ' ", pattern );
Regex* regex = gcnew Regex( pattern );
String* line = S "one\ttwo three:four,five six seven ";
Console::WriteLine( S "text : '{0} ' ", line );
for( Match* match = regex-> Match( line );
match-> Success; match = match-> NextMatch( ) )
{
if( match-> Value-> Length > 0 )
{
words++;
Console::WriteLine( S "{0} ", match-> Value );
}
}
Console::WriteLine( S "Number of Words : {0} ", words );
return 0;
}
------解决方案--------------------------------------------------------
应该是
------解决方案--------------------------------------------------------
.net库有什么好的,还不是以前C++用的库或写的库的包装
------解决方案--------------------------------------------------------
注意,创建托管的才行,非托管的不行,你在2003中创建一个CLR窗口程序,应该能运行这代码吧