我复制了这个结构
typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */
SDL_Rect clip_rect; /* Read-only */
8 int refcount; /* Read-mostly */
/* This structure also contains private fields not shown
here */} SDL_Surface;
并尝试使用/*和*/以及代码的开头和结尾进行注释(换行),但这不起作用。
/*
typedef struct SDL_Surface { //only commented out this line
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */
SDL_Rect clip_rect; /* Read-only */
8 int refcount; /* Read-mostly */
/* This structure also contains private fields not shown
here */} SDL_Surface;
*/
有谁可以帮我?
发布于 2013-04-15 02:29:55
使用
#if 0
blah
#endif
“注释掉”像这样的大块代码。它还具有嵌套的好处。
( /*
和*/
不工作的原因是,一旦在注释中,第一个*/
将结束它,因此/* blah /* explanation */ more */
将在explanation
之后结束,而不是more
)
发布于 2013-04-15 02:31:05
嵌套注释不起作用,但您可以让预处理器跳过该结构
#if 0
typedef struct SDL_Surface {
Uint32 flags; /* Read-only */
SDL_PixelFormat *format; /* Read-only */
int w, h; /* Read-only */
Uint16 pitch; /* Read-only */
void *pixels; /* Read-write */
SDL_Rect clip_rect; /* Read-only */
8 int refcount; /* Read-mostly */
/* This structure also contains private fields not shown
here */} SDL_Surface;
#endif
https://stackoverflow.com/questions/16002704
复制相似问题