Use of Checked and UnChecked operators?
Answers were Sorted based on User's Feedback
Answer / jackir
when value of a datatype excided its limitaion then its
call overflow to avoid this problem we use ckecked and
unchecked
syntax
return unchecked(x+y);
return checked(x+y);
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / hridya
In a checked context, if the operation is a constant
expression a compile-time error occurs. Otherwise, when the
operation is performed at run-time, a
System.OverflowException is thrown.
In an unchecked context, the result is truncated by
discarding any high-order bits that do not fit in the
destination type.
| Is This Answer Correct ? | 4 Yes | 0 No |
Can list contain duplicates c#?
i have a string aabccefsdss.how can i get the string abcefsd. or write the fallowing string with only character occurrence of once .
What is private readonly in c#?
How do I do a case-insensitive string comparison?
What do you mean by winforms in c#?
How can you prevent escaping on backslashes in C# with string definitions?
what is object-oriented programming (oop) language?
what is unit testing
What is the difference between console application and windows application?
When should we use delegates in c#?
How to call a function when a class implements 2 interfaces and function is present in both interfaces?
How many variables do you need?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)