So here is the problem. This won't compile. It always gives an error like :
d.cpp:24: error: ‘string’ was not declared in this scope
d.cpp:24: error: expected ‘,’ or ‘;’ before ‘{’ token
Compilatie failed.
#include <iostream>
#include <string>
#include <stdlib.h>
#include <time.h>
int d(int amount, int dots){ // d(X,Y) notation.
/* initialize random seed: */
srand (time(NULL));
int sum = 0;
int temp = 0;
for (int i = 0; i <amount ; i++)
{
temp = rand() % dots + 1;
sum = sum + temp;
}
return sum;
}
int d(int dots){
int temp = d(1, dots);
return temp;
}
int extract_d(string s){
int stringsize = s.size();
int eindwaarden[3] = {0,0,0};
int waarde = 0;
int eerstekeer = 0;
for (int count = 0; count < stringsize; count++){
if(s[count] == 100 || s[count] == 43){
waarde++;
}
else if(eerstekeer == 0){
eindwaarden[waarde] = s[count] - '0';
eerstekeer++;
}
else {
eindwaarden[waarde] *= 10;
eindwaarden[waarde] += s[count] - '0';
}
}
return (d(eindwaarden[0],eindwaarden[1])) + eindwaarden[2];
}
And i don't really see the problem, i included string right?
Please help....