Results 1 to 4 of 4
setupterm(NULL, fileno(stdout), (int *)0);...
- 05-03-2009 #1Just Joined!
- Join Date
- May 2009
- Posts
- 4
C: what does (int*)0 meaning
setupterm(NULL, fileno(stdout), (int *)0);
- 05-03-2009 #2
(int *)0 creates a NULL integer pointer or a integer pointer equal to zero meaning it points to nothing....G4143
Make mine Arch Linux
- 05-04-2009 #3Just Joined!
- Join Date
- May 2009
- Posts
- 4
thanks for it
- 05-04-2009 #4Linux Guru
- 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!


Reply With Quote