array histogram random number

why wont this execute. i keeping getting { undeclared and old-style format error
#include <iostream>
#include<stdlib.h>
using namespace std;
#include <string>
#define _DICE_H
#include <vector>

vector<int> rollDice(int rollCount)
// pre: rolls > 0
// post: returns vector of counts with v[k] = # times k rolled
// when 2 six-sided dice are rolled rollCount times
{

vector<int> counts(13, 0); // make room for rolls 2-12, all zero
int _DICE_H; int roll();
_DICE_H (6);

{ for (int k = 0; k < rollCount; k++)
int roll = 6;
counts[6] += 1;
}
return counts;
}
int maxValue(vector<int> counts);
// pre: 12 < counts.size(), so counts[12] is legal index/entry
// post: returns largest value in counts[2] .. counts[12]
{

int max = counts[2];
for (int k = 3; k <= 12; k++){
if (counts[k] > max){
max = counts[k]
}
}
return max;
}

void makeStars(int count)
// post: prints count '*' asterisks on current line
{
for (int k = 0; k < count; k++){
cout << "*";
}
}

int main()
{
int rollCount = 50000;
vector<int> counts = rollDice(rollCount);
int max = maxValue(counts);

for (int k = 2; k <= 12; k++){
cout << k << "\t" << counts[k] << "\t";
makeStars(40 * counts[k] / max);
cout << endl;
}

return 0;
}
Please, use the code tags and informative indentation/style. They make the code much more readable and easier to comment too.

Compiler errors do mention the line of code, that the error message refers to. That is valuable information.
line 27 and 28.....
Topic archived. No new replies allowed.