What is the difference between typeof(foo) and myFoo.GetType()?

Answers were Sorted based on User's Feedback



What is the difference between typeof(foo) and myFoo.GetType()?..

Answer / enso

Operator typeof(foo) is used to obtain the System.Type
object for a type at compile time.

myFoo.GetType() is used to obtain the exact run time type of
an object. This method uses reflection.

Is This Answer Correct ?    11 Yes 1 No

What is the difference between typeof(foo) and myFoo.GetType()?..

Answer / nidhi

Operator typeof(foo) is used to obtain the System.Type
object for a type at compile time.
myFoo.GetType() is used to obtain the exact run time type of
an object. This method uses reflection.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More C Interview Questions

What does 2n 4c mean?

0 Answers  


What is oops c?

0 Answers  


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300

4 Answers   Tieto,


Who is the main contributor in designing the c language after dennis ritchie?

0 Answers  


What is pass by reference in c?

0 Answers  






hi , please send me NIC written test papers to sbabavalli@gmail.com

0 Answers   NIC,


What does c value mean?

0 Answers  


main() { int x=20,y=35; x = y++ + x++; y = ++y + ++x; printf("%d %d\n",x,y); }

27 Answers   Advent Global Solutions, CitiGroup, Valeo Lighting Systems India Private Limited, Vishal Transformers, Wipro, Zencer,


What is the purpose of ftell?

0 Answers  


write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.

0 Answers   Subex,


1.int a=10; 2.int b=20; 3. //write here 4.b=30; Write code at line 3 so that when the value of b is changed variable a should automatically change with same value as b. 5.

0 Answers  


main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*

1 Answers  


Categories