Find the answer to your Linux question:
Results 1 to 4 of 4
setupterm(NULL, fileno(stdout), (int *)0);...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    4

    Question C: what does (int*)0 meaning

    setupterm(NULL, fileno(stdout), (int *)0);

  2. #2
    Linux Enthusiast gerard4143's Avatar
    Join Date
    Dec 2007
    Location
    Canada, Prince Edward Island
    Posts
    714
    (int *)0 creates a NULL integer pointer or a integer pointer equal to zero meaning it points to nothing....G4143
    Make mine Arch Linux

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    4
    thanks for it

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    The ANSI C standard allows leaving the cast (int*) off for a null value. IE, you can use "setupterm(0, fileno(stdio), 0)" instead. The gcc compiler suite for Linux is fully ANSI-compliant, and in fact the way I showed is actually preferable because NULL is a macro defined in a system header file to be (void*)0, which will not work if your function expects a char*, for example. However, 0 may be used for a null pointer of any type.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...