invalid operands of typs ‘double’ & ‘int’ to binary ‘operator%’
why do i get this error:
invalid operands of typs ‘double’ & ‘int’ to binary ‘operator%’
:Btw im trying to generate a 10 element vector such each element is randomly generated that falls within the range of [0.1,1.0]
below is my code:
1 2 3 4 5
|
vector<double> B(10);
srand(time(0));
for (int j=0;j<10;j++){
B[j]=0.1*rand()%10;
cout<<B[j];}
| |
Topic archived. No new replies allowed.