I am trying to write a yahtzee program and I found a thread on here with a dice roller. I tried to compile it to see how it worked and it is giving me the following:
Line 9 Column 1
Error C2883: 'rand' : function declaration conflicts with source.cpp 'rand' introduced by using-declaration.
I checked and it doesn't seem like rand is being declared more than once so I have no idea what is going wrong with this.
No. It complains about line 9. rand function is already declared in cstdlib. So what exactly do you want to do with it on line 9? The compiler tries to create an int variable with the same name as a function already declared, and initialize it with a void. Obviously that does not work out well.
The compiler tries to create an int variable with the same name as a function already declared, and initialize it with a void. Obviously that does not work out well.
It is actually a prototype of a function called rand that returns an int and takes no arguments. That is why it is causing an error.