请参阅编译时间和运行时间之间的差异...引用类型&值类型 [英] please what is defference between compile time and run time...reference type & value type

查看:177
本文介绍了请参阅编译时间和运行时间之间的差异...引用类型&值类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我是初学者
请在编译时间和运行时间之间有何不同...引用类型和值类型,如果可能的话,请简单说明.

Hii everyone,i''m beginner
please what is defference between compile time and run time...reference type & value type in easy explain if its possible.

推荐答案

初学者的最佳去处C#是要读一本书并编写大量代码.该链接可能有助于一般理解C#和值类型以及引用类型和类型的基础: C#类型参考 [ ^ ]

编译时间:当您在Visual Studio IDE中编写代码时(在这种情况下),当您尝试运行该程序时收到错误消息,或者在编写错误的代码时出现一小段混乱的行,即C#编译器在后台检查错误,因此甚至可以在运行代码之前进行修复.

运行时间:代码已编译并正在执行指令时程序的运行状态.

希望这个非常基本的解释可以帮助您开始.

欢呼
The best place for beginners to learn about C# is to read a book and write lots of code. This link might help to understand the basics of C# and value types and ref types and types in general: C# Types Reference[^]

Compile time: when you are writing code in the Visual Studio IDE (in this case) and you get an error when you try to run the program or you get a squiggly little line when you write wrong code, that''s the C# compiler in the background that''s checking for errors so you can fix it even before running your code.

Run time: the running state of your program when the code has been compiled and is executing instructions.

Hope this very basic explanation helps you kick-off.

Cheers


编译时间"是指构建代码时-编译器将源代码转换为IL时.

运行时"是执行代码的时间-对于ASP.NET,是在发出页面请求时执行的. (我个人更喜欢用执行时间"一词来区分它和公共语言运行时(CLR)"(又名虚拟机).)


有关编译时间与运行时的更多说明,请参见此内容.

http://stackoverflow.com/questions/846103/runtime-vs-compile-time [ ^ ]

关于值与引用类型的关系:
值类型:它将保存实际值. int,bool,float是值类型
引用类型:它将地址保存为值.字符串,对象是引用类型.


要了解有关值vs引用的更多信息,您应该了解堆栈和堆以及如何保存数据.

查看本文以了解更多信息.

六个重要的.NET概念:堆栈,堆,值类型,引用类型,装箱和拆箱 [
"Compile time" is when you build your code - when the compiler converts your source code into IL.

"Runtime" is when your code is executed - for ASP.NET, when a page request is made. (Personally I prefer the term "execution time" to distinguish between that and "the Common Language Runtime (CLR)" - aka the virtual machine.)


see this for more explanation about compile time vs runtime.

http://stackoverflow.com/questions/846103/runtime-vs-compile-time[^]

And about value vs reference type:
Value type : It will hold the actual values. int, bool, float are value types
Reference type: it will hold the address to the values. string, objects are reference type.


To know more about value vs ref, you should know stack and heap and how data are saved.

Check this article to know about more.

Six important .NET concepts: Stack, heap, value types, reference types, boxing, and unboxing[^]


这篇关于请参阅编译时间和运行时间之间的差异...引用类型&值类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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