我正在学习 SDL,我在手册中找到了这段代码:
SDL_Rect **modes;
int i;
/* Get available fullscreen/hardware modes */
modes=SDL_ListModes(NULL, SDL_FULLSCREEN|SDL_HWSURFACE);
/* Check is there are any modes available */
if(modes == (SDL_Rect **)0){
printf("No modes available!\n");
exit(-1);
}
/* Check if or resolution is restricted */
if(modes == (SDL_Rect **)-1){
printf("All resolutions available.\n");
}
else{
/* Print valid modes */
printf("Available Modes\n");
for(i=0;modes[i];++i)
printf(" %d x %d\n", modes[i]->w, modes[i]->h);
}
我现在认为模式是指向 SDL_rect 数组的指针,但表达式:
(modes== (SDL_Rect **)0)
逃脱了我的推理。(SDL_Rect **)0 是什么意思?