过客
路过!
posts - 133, comments - 31, trackbacks - 2, articles - 3
博客园
::
首页
::
新随笔
::
联系
::
订阅
::
管理
日历
公告
关于sizeof,typeof
Posted on
2008-11-25 18:05
过客路过
阅读(104) 评论(
0
)
编辑
收藏
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
}
}
刷新评论
刷新页面
返回顶部
程序员问答社区,解决您的IT难题
博客园首页
博问
新闻
闪存
程序员招聘
知识库
Powered by:
博客园
Copyright © 过客路过