过客
路过!
posts - 133, comments - 31, trackbacks - 2, articles - 3
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
日历
公告
2008年11月25日
关于sizeof,typeof
Code
using
System;
using
System.Text;
using
System.Collections.Generic;
public
class
Class1
{
public
Class1()
{
}
static
void
Main(String[] args)
{
Double dl
=
3.1546
;
int
getType
=
sizeof
(
double
);
Console.WriteLine(getType.ToString());
//
putout:8
Type gtype
=
dl.GetType();
Type g_type
=
typeof
(
int
);
Console.WriteLine(g_type.ToString());
//
putout:System.Int32
Console.WriteLine(gtype.ToString());
//
putout:System.Double
Type s_Short
=
typeof
(
short
);
Console.WriteLine(s_Short.ToString());
//
output:System.Int16
}
}
posted @ 2008-11-25 18:05 过客路过 阅读(104) 评论(0)
编辑
Powered by:
博客园
Copyright © 过客路过