User forums > Using Code::Blocks
Downloading time.h
(1/1)
fs444:
When I write
--- Code: ---#include <time>
--- End code ---
and compile code, I got error
--- Quote ---fatal error: time: No such file or directory
--- End quote ---
Where I can download time.h ?
I use CodeBlocks 16.01 and MinGW.
oBFusCATed:
If you want time.h then tell the compiler to include it using #include <time.h>!
fs444:
I have done it already. This is full program code
--- Code: ---//casting of a hexahedral bone 6000 times
#include <iostream>
#include <iomanip>
#include <stdlib>
#include <time>
using namespace std;
int main()
{
const int arraySize = 7;
int face, frequency[arraySize] = {0};
srand(time(NULL));
for (int roll = 1; roll <= 6000; roll++) {
face = rand() % 6 + 1;
++frequency[face];
}
cout << "Gran" << setw(17) << "Chastota" << endl;
for (face = 1; face <= arraySize; face++)
cout << setw(4) << face
<< setw(17) << frequency[face] << endl;
return 0;
}
--- End code ---
stahta01:
--- Quote from: oBFusCATed on June 04, 2017, 01:30:43 am ---If you want time.h then tell the compiler to include it using #include <time.h>!
--- End quote ---
"time" is NOT the same as "time.h" that is what oBFusCATed posted.
Please read and fix your code or go to a site the supports programming!
Edit: "time" is also not the same as "ctime".
Read the rules: http://forums.codeblocks.org/index.php/topic,9996.0.html
Tim S.
fs444:
Yes, you right, time.h resolved this problem. Thank you.
Navigation
[0] Message Index
Go to full version