Undefined values: Difference between revisions
Content added Content deleted
Line 72: | Line 72: | ||
</pre> |
</pre> |
||
=={{header|C sharp|C#}}== |
|||
<lang C> |
|||
#include<stdlib.h> |
|||
#include<stdio.h> |
|||
int main() |
|||
{ |
|||
int i=NULL; |
|||
if(i==NULL) |
|||
{ |
|||
printf("i is undefined."); |
|||
} |
|||
else |
|||
{ |
|||
printf("So much for writing code."); |
|||
} |
|||
return 0; |
|||
} |
|||
</lang> |
|||
And the output is: |
|||
<lang C> |
|||
i is undefined. |
|||
</lang> |
|||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
In C# it's important to see the difference between reference and value types. For reference types (class instances) there is <code>null</code> as a general undefined reference. |
In C# it's important to see the difference between reference and value types. For reference types (class instances) there is <code>null</code> as a general undefined reference. |