简体   繁体   English

预期语句错误

[英]Expected a statement Error

I'm getting an Expected a Statement error in this else statement 我在其他else语句中遇到了Expected Statement错误

if (surface == NULL);
     std::cout << "error" << std::endl;
else 
{
    optimizedSurface = SDL_ConvertSurface(surface, windowSurface->format, 0);
}

How do I fix this? 我该如何解决?

remove the ; 删除; after if . if之后。 if (surface == NULL); should be if (surface == NULL) 应该是if (surface == NULL)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM