Question
class UnsafeCode
{
unsafe static void Main()
{
int n = 10;
void* p = &n;
Console.WriteLine(*p);
Console.ReadLine();
}
}
a.
The program will print 10
b.
Run time error
c.
Compile time error
d.
Output is the address contained in p
Posted under C# programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What will be the output of the given code segment?
Similar Questions
Discover Related MCQs
Q. Which among the following is referred as an array of pointers?
View solution
Q. Among the given pointer which of following cannot be incremented?
View solution
Q. How many values can be returned from a function simultaneously using pointers?
View solution
Q. Consider an integer pointer *a.
++*a will increment ___________ while *a++ will increment __________
View solution
Q. Among the given pointers which of following cannot be incremented?
View solution
Q. A structure pointer points to __________
View solution
Q. What will be the declaration of the variable ptr as the pointer to array of 6 floats?
View solution
Q. Choose the statement which defines the Nullable type Correctly:
View solution
Q. What does the following code depicts?
1. System.Nullable count;
2. bool? done;
View solution
Q. Which operator is commonly used to find the size of the type of C#?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!