¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita0
What is the range of rand()
what is the min and max value returned by the rand() function in C++?
5 Respuestas
+ 1
@K2 Shape. rand return int, yes. But standart guarantees only [0; 32767]. On some compilers the range could be wider.
+ 2
The range is from 0 to 2^64
0
The min: 0
The max: 32767 (in some compilers can be larger)
0
I know it's nixe to ask here but its an important step to start learning to use the official C++ documentation. It's not really more work and you will get your answer immediately.
0
And int is the 32bit variable and can store 2^32 numbers