/*★ 算術 Data の最小値と最大値 前田 稔 ★*/ using namespace System; int main() { String^ format = "{0, -8}:{1}~{2}"; String^ dot = "----------------"; Int16 mn16 = 0, mx16 = -1; Int32 mn32 = 0, mx32 = -1; Int64 mn64 = 0, mx64 = -1; Console::WriteLine(format, "SByte",SByte::MinValue, SByte::MaxValue); Console::WriteLine(format, "Byte",Byte::MinValue, Byte::MaxValue); Console::WriteLine(format, "Char",Char::MinValue, Char::MaxValue); Console::WriteLine(dot); Console::WriteLine(format, "Int16", Int16::MinValue, Int16::MaxValue); Console::WriteLine(format, "UInt16", (UInt16)mn16, (UInt16)mx16); Console::WriteLine(format, "Int32", Int32::MinValue, Int32::MaxValue); Console::WriteLine(format, "UInt32", (UInt32)mn32, (UInt32)mx32); Console::WriteLine(format, "Int64", Int64::MinValue, Int64::MaxValue); Console::WriteLine(format, "UInt64", (UInt64)mn64, (UInt64)mx64); Console::WriteLine(dot); Console::WriteLine(format, "Single", Single::MinValue, Single::MaxValue); Console::WriteLine(format, "Double", Double::MinValue, Double::MaxValue); Console::WriteLine(dot); //Console::ReadLine(); return 0; } --------------------------------------------------------------------- C# での実行結果です。 C++/CLI でプログラムを実行して、結果を確かめて下さい。 C:\DATA\Cpp\Maneged>DataType SByte :-128~127 Byte :0~255 Char : ~? ---------------- Int16 :-32768~32767 UInt16 :0~65535 Int32 :-2147483648~2147483647 UInt32 :0~4294967295 Int64 :-9223372036854775808~9223372036854775807 UInt64 :0~18446744073709551615 ---------------- Single :-3.402823E+38~3.402823E+38 Double :-1.79769313486232E+308~1.79769313486232E+308 ---------------- C:\DATA\Cpp\Maneged>