赞
踩
限定符 | 含义 |
---|---|
const | const 类型的对象在程序执行期间不能被修改改变。 |
volatile | Volatile修饰符:不需要优化,让程序可以直接从内存中读取变量。变量直接放到寄存器中加快读写效率。 |
restrict | 由 restrict 修饰的指针是唯一一种访问它所指向的对象的方式。 |
#include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main () { int j; // 设置随机数种子 srand( (unsigned)time( NULL ) ); // 生成实际的随机数 j= rand(); cout <<"随机数: " << j << endl; return 0; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。