繁体   English   中英

我无法解决此问题 [错误] 'rand' 未在开发 c++ 的此 scope 中声明

[英]i could not solve this [Error] 'rand' was not declared in this scope in dev c++

void Setup() {
    gameover = false;
    dir = STOP;

    x = width / 2;
    y = height / 2;

    fruitX = rand() % width; //display fruit in a random place
    fruitY = rand() % height; score = 0;
}

请使用 c 代码顶部的#include <stdlib.h>

暂无
暂无

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

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