Hmm, i'm guessing that when the NULL_open is called, it is always called with an argument, though were it to be called with nothing it would crash.
Anyways, assuming it is called with one argument, could you please show me how to recast the function to one that does not take any arguments? ? I ask because I'm learning C++ on this project itself.
Thank you
Saptarshi
User Profile
Collapse
-
Thank you for the replies. I understand the predicament involved in expecting arguments but getting none (because of the declaration and definition contrasts)
But then how does this compile and run in C?
I can say this, because it is part of the R source code (The R Project - a statistical software - the code is in src/library/grDevices/src/devNull.c)
and it works!
I wanted to use QT, so i need to compile with...Leave a comment:
-
Function Pointers in C not compiling with g++
Hi
I have header file in C (which cannot be changed).
GraphicsDevice. h
Now another code(which also compiles in C) assigns to open like thisCode:---some code--- Rboolean (*open)(); ---code continues
dev->open = NULL_Open;
where NULL_Open is defined as
I...Code:static Rboolean NULL_Open(NewDevDesc *dev) { return TRUE; }
No activity results to display
Show More
Leave a comment: