unsigned int :: Parse(控制台:: ReadLine()); [英] unsigned int::Parse(Console::ReadLine());
问题描述
unsigned int :: Parse(控制台:: ReadLine()); //c ++/cli
大家好,有人可以解释一下上面的代码为什么是错误的(Microsoft Visual Studio 2015上的智能提示不允许输入类型名).但是int :: Parse(Console :: ReadLine());不是错误,double :: Parse(Console :: ReadLine());
等不是错误.
unsigned int::Parse(Console::ReadLine()); // c++/cli
Hi guys, please can someone explain why the above code is an error(intellisense on microsoft visual studio 2015 says typename is not allowed) but int::Parse(Console::ReadLine()); is not an error, double::Parse(Console::ReadLine());
etc is not an error.
欢呼
推荐答案
UInt32::Parse(Console::ReadLine()); // c++/cli
某些单字类型将自动转换为其相应的类名. int 成为 System :: Int32 ,并且 string 成为 System :: String . 但是 unsigned int 是两个词,不能用作其类名.
Some one-word types will automatically convert to their corresponding class names. Like int becomes System::Int32 and string becomes System::String. But unsigned int is two words, and can't be used as its class name.
烦人的C ++/CLI怪癖.
Annoying quirk of C++/CLI.
这篇关于unsigned int :: Parse(控制台:: ReadLine());的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!