c# ref 传入null怎么做?
本文介绍了c# ref 传入null怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
SDL.SDL_UpdateTexture(sdlTexture, 传入NULL, ptr, pixel_w);
这里需要传入一个空值,
public static extern int SDL_UpdateTexture(
IntPtr texture,
ref SDL_Rect rect,
IntPtr pixels,
int pitch
);
类型是ref SDL_Rect rect 的,我应该怎么做?
解决方案
SDL_Rect r = null;
SDL.SDL_UpdateTexture(sdlTexture, ref r, ptr, pixel_w)
这篇关于c# ref 传入null怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文