开发者

Expected Initializer Before 'double'

What could be the possible error in this line :

double bx;

bx I define universally ! but I am getting the above error on compiling .Even for float bx; I get the same kind of error .

The surrounding code is :

#include "header.h"
#include "ball_pad.h"
#include "pingpong.h"
#include "texture.h"
#include "3dsloader.h"


float A = 90.0f;
float B = 70.0f;
/**********************************************************
 *
 * VARIABLES DECLARATION
 *
 *********************************************************/

// The width and height of your window, change them as you like
int screen_width=640;
int screen_height=480;

// Absolute rotation values (0-359 degrees) and rotation increments for each frame
double rotation_x=0, rotation_x_increment=0.1;
double rotation_y=0, rotation_y_increment=0.05;
double rotation_z=0, rotation_z_increment=0.03;

// Absolute rotation values (0-359 degrees) and rotation increments for each frame
double translation_x=0, translation_x_increment=1.0;
double translation_y=0, translation_y_increment=0.05;
double translation_z=0, translation_z_increment=0.03;

// Flag for rendering as lines or filled polygons
int filling=1; //0=OFF 1=ON

//Now the object is generic, the cube has annoyed us a little bit, or not?
obj_type board,ball,pad_alongX,pad_alongY;

BALL ball1//,ball2,ball3;
dou开发者_如何学运维ble bx = 0;
double by = 0;
double bvx = 2.0;
double bvy = 2.0;
double radius = 5.0;
//ball2.bx = 0;ball2.by = 0;ball2.bvx = 2.0;ball2.bvy = 2.0;ball2.radius = 5.0;
//ball3.bx = 0;ball3.by = 0;ball3.bvx = 2.0;ball3.bvy = 2.0;ball3.radius = 5.0;

PADDLE pad1,pad2,pad3,pad4;
//pad1.px = 0;pad1.py = 0;pad1.pvx = 2.0;pad.pvy = 2.0;pad1.length = 25.0;pad1.width = 5.0;


You are missing a semicolon there:

BALL ball1//,ball2,ball3;
double bx = 0;

It should be:

BALL ball1; //,ball2,ball3;
double bx = 0;


Probably a semicolon notation is missing from the last statement before this declaration.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜