[英]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.