correct way to initialize pointer...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

This is more of a 'C' question than a kernel one. But since i'll be putting this
in a module, I thought I'd ask here too...

Whats the correct way to initialize a pointer?

1. char *p = 0;
OR
2. char *p = NULL;


Say I'm doing this for a local var in a function. Are there any portability issues
with either of them?

Thanks,
-mandeep

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux