Search code examples
c++allegro5

error c2447 missing function header (old-style formal list )


I get this error but I have no idea where I could have went wrong here are the three functions below... I just really don't understand what is missing

void InitBullet(Bullet bullet[], int size) //init bullet
{
    for (int i = 0; i < size; i++)
    {
        bullet[i].ID = BULLET; //ID
        bullet[i].speed = 10; //bullet speed (10)
        bullet[i].live = false; //bullet isnt live it hasnt been fired
    }
}

void drawBullet(Bullet bullet[], int size) //drawing bullet to screen
{
    for (int i = 0; i < size; i++)
    {
        if (bullet[i].live) //if bullet is live
            al_draw_filled_circle(bullet[i].x, bullet[i].y, 2, al_map_rgb(255, 0, 0)); //red circle primitives for bullets
    }
}

void fireBullet(Bullet bullet[], int size, submarine &sub) //
{
    for (int i = 0; i < size; i++) //looking for deadbullets 
    {
        if (!bullet[i].live)
        {
            bullet[i].x = sub.x + 17; // 17 looks the best
            bullet[i].y = sub.y;
            bullet[i].live = true; // turning the bullet on
            break; //only one at a time
        }

    }
{

Solution

  • The last bracket is the wrong way around.