LoginSignup

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

null

Posted at

#include <stdio.h>
#include <stdlib.h>

#define nullnull ((void*)0)
#define nullconst (0)

int main(int argc, char** argv)
{
  int x = nullnull; /* 警告 */
  int y = nullconst;

  if(x == y) puts("same");

  return 0;
}
/*
  GNU C++(__GNUG__)の場合 … __null
  GNU C++でなく、Cの場合 … ((void *)0)
  GNU C++でなく、C++の場合 … 0
*/


0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up