digitalmars.D.learn - error
- Concealment (8/8) Nov 01 2016 void main(string[] args)
- Adam D. Ruppe (4/5) Nov 01 2016 did you import anything? `import core.stdc.stdlib;` I think will
- Concealment (4/10) Nov 01 2016 yea i did import core.stdc.stdlib; but it still gives me the same
- Jonathan M Davis via Digitalmars-d-learn (5/17) Nov 01 2016 It's in core.stdc.time. The druntime modules are supposed to correspond ...
void main(string[] args) { srand(time(null)); int p1 = rand() % 7; p1++; i compiled this program i wrote... but it keeps giving me an error main.d(17): Error: undefined identifier 'time' can someone help me please?
Nov 01 2016
On Wednesday, 2 November 2016 at 01:27:32 UTC, Concealment wrote:can someone help me please?did you import anything? `import core.stdc.stdlib;` I think will fix that one, but generally you need an import to use lib functions.
Nov 01 2016
On Wednesday, 2 November 2016 at 01:32:27 UTC, Adam D. Ruppe wrote:On Wednesday, 2 November 2016 at 01:27:32 UTC, Concealment wrote:yea i did import core.stdc.stdlib; but it still gives me the same errorcan someone help me please?did you import anything? `import core.stdc.stdlib;` I think will fix that one, but generally you need an import to use lib functions.
Nov 01 2016
On Wednesday, November 02, 2016 01:36:23 Concealment via Digitalmars-d-learn wrote:On Wednesday, 2 November 2016 at 01:32:27 UTC, Adam D. Ruppe wrote:It's in core.stdc.time. The druntime modules are supposed to correspond to the C header files, and time is in time.h, not stdlib.h. - Jonathan M DavisOn Wednesday, 2 November 2016 at 01:27:32 UTC, Concealment wrote:yea i did import core.stdc.stdlib; but it still gives me the same errorcan someone help me please?did you import anything? `import core.stdc.stdlib;` I think will fix that one, but generally you need an import to use lib functions.
Nov 01 2016