你所说的强类型检查是什么意思 [英] what do u mean by strong type checking

查看:82
本文介绍了你所说的强类型检查是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是确定分配给变量的值的类型吗?

is it the case of determining the type of value assigning to the variable?

推荐答案

是的!你的怀疑是对的.当类型系统对涉及不同数据类型的值的操作如何进行混合指定了一个或多个限制时,它被认为具有强类型.
那里-[强键入] [ 参考链接:- MSDN- [铸造和类型转换(C#编程指南)] [ ^ ]
yeah! your suspecting is right. A type system is said to feature strong typing when it specifies one or more restrictions on how operations involving values of different data types can be intermixed.
Read more from there-[Strong typing][^]
C# is strongly type-safe. It has support for untyped pointers, but this must be accessed using the "unsafe" keyword which can be prohibited at the compiler level. It has inherent support for run-time cast validation.
Reference Link :- MSDN-[Casting and Type Conversions (C# Programming Guide)][^]


yes ..这也意味着您不能将双精度值赋给整数变量.您必须明确指定类型转换.

yes.. it also means that you can not assign a double value to an integer variable. you have to explicitly specify the type casting.

int i = 10;
double d = 10.10;

i = d;//error

string s = i;// error in c# not in VB.NET




http://cplus.about.com/od/learnc/ss/csharptutorial_5.htm [ ^ ]




http://cplus.about.com/od/learnc/ss/csharptutorial_5.htm[^]


这篇关于你所说的强类型检查是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆