Click here to Skip to main content
15,890,579 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted
Comments
[no name] 4-Aug-12 21:02pm    
With your history, don't you think that you would benefit from taking a class or maybe sitting down and reading a book? Think about what you are asking here. What do you think the difference between compiling a program and running a program is? Asking basic question after question and trying to learn programming one question at a time is not going to get you past this "beginner" phase.
mhassan083 5-Aug-12 1:37am    
my dear wes, i'm still studing c# and depending on book ,sometimes i find some concepts not clear to me in this book
[no name] 5-Aug-12 9:09am    
Sorry but that is, what used to called, a copout. An excuse designed to shirk responsibility. If you have to ask what the difference is between compiling a program and running a program or what a return statement does then that is being just plain lazy.

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
 
Share this answer
 
"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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900