Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,851 questions

51,772 answers

573 users

What is a NULL pointer in C

2 Answers

0 votes
// NULL pointer is a pointer pointing to nothing 

#include <stdio.h> 
 
// #define NULL 0 in stdio.h
 
int main(int argc, char **argv) 
{ 
    int *p = NULL;
    
    printf("%p",p); // A pointer that point to nothing.
    
    return(0);
}

 
 
/*
 
run:
 
0000000000000000
 
*/

 



answered May 5, 2017 by avibootz
edited Jun 21, 2017 by avibootz
0 votes
// NULL pointer is a pointer pointing to nothing 
 
#include <stdio.h>
 
int main(void)
{
    int *p1 = NULL;
     
    printf("p1 = %p\n", p1); 
     
    int *p2 = '\0';
     
    printf("p2 = %p\n", p2); 
     
    return 0;
}
 
   
/*
run:
     
p1 = 0000000000000000
p2 = 0000000000000000
 
*/

 



answered Jun 21, 2017 by avibootz

Related questions

2 answers 190 views
1 answer 106 views
1 answer 109 views
109 views asked May 13, 2021 by avibootz
1 answer 129 views
129 views asked Jun 21, 2017 by avibootz
1 answer 252 views
252 views asked Jun 20, 2017 by avibootz
1 answer 155 views
155 views asked May 5, 2017 by avibootz
...