Humble Devassy Chirammal › Forums › C-programming.. › NULL Pointer and NUL in C programming.
Tagged: NULL pointer nul c programming.
- This topic has 2 replies, 1 voice, and was last updated 3 hours, 54 minutes ago by
wontera.
-
AuthorPosts
-
Humble
KeymasterNull pointer does not point to any thing.. so, dont try to dereference.. you can use “0” or “NULL” when initializing a null pointer.. Depending on the implementation , different type of pointer which initialized to NULL gets its own value. To avoid problems in function call context,it is better to type cast “0” to its own data type ( what function definition assumes) when passing NULL pointer as an argument.
Please note the “NULL” is different from “NUL”. That said, latter is used for representing end of string and no where related to null pointer.
Humble
Keymaster#include
int main()
{
int *p = NULL;if (p == NULL)
{
printf (“p is NULL\n”);
}
else
{
printf (“p is not NULL\n”);}
}Above produce below result :
[hchiramm@humbles-lap ]$ ./a.out
p is NULLBut, if we have below code :
#include
int main()
{
int *p = NULL;
if (p)
{
printf (“p is NULL\n”);
}
else
{
printf (“p is not NULL\n”);}
}[hchiramm@humbles-lap ]$ ./a.out
p is not NULLBecause NULL is represented as binary zero in a system, that said, binary zero is treated as “false” in C, so else clause is getting executed..
In standard libike this:
#define NULL ((void*)0)
Dereferencing a NULL pointer will result in ‘segmentation fault” .
wontera
GuestPayment information is one of the first things I would check when researching an online casino. Different platforms may offer different methods and conditions for deposits or withdrawals, so reading those details can be useful before considering anything else. Verification requirements and general account rules should also be reviewed. For a broader comparison, stay-casino-au.bet can be examined together with other casino websites.
-
AuthorPosts