On 04/04/16 20:19, Heinz-Mario Frühbeis wrote:
> Hi,
>
> can I use these functions as [1]?
>
> [1]
> Display* Dispplay_Open(){
> return XOpenDisplay(NULL);
> }
>
> int Display_Close(Display *vDisplay){
> return XCloseDisplay(vDisplay);
> }
>
> void Test(){
> Display *nDisplay = NULL;
> nDisplay = Display_Open();
> Display_Close(nDisplay);
> }
>
> Or do I need to use a pointer on a pointer?
>
> [2]
> int Display_Close(Display **vDisplay){
> return XCloseDisplay(*vDisplay);
> }
Given XCloseDisplay() takes a Display*, why would you need a pointer to
pointer? The only reason to do this is if you are going to modify the
parameter value.
--
Ian Collins