MSVC++V6 isn't letting me pass the struct member foe into my function bulletsort. This is legal, isn't it? I've tried everything I can but nothing is right. The error messages I get are below the code. Does anyone know what I should do?
Code:struct person {int x, y,move,x_offset,y_offset,foe;}; int bulletsort(bulleter.foe) { int count; if(person bulleter.foe) { for(count=8;count<17;count++) { if(ammo[count].exists=TRUE) return count; } return -1; } else { for(count=0;count<8;count++) { if(ammo[count].exists=TRUE) return count; } return -1; } } END_OF_FUNCTION(bulletsort); int fire_bullet(person gunner) { int count; if((count=bulletsort(gunner.foe))==-1) return 1; ammo[count].x=gunner.x; ammo[count].y=gunner.y; ammo[count].direction=gunner.move%2; return 0; } END_OF_FUNCTION(fire_bullet);
C:\Program Files\Microsoft Visual Studio\MyProjects\ActionGameV2\ActionGameV2.cpp(20 ) : error C2065: 'bulleter' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\ActionGameV2\ActionGameV2.cpp(20 ) : error C2228: left of '.foe' must have class/struct/union type
C:\Program Files\Microsoft Visual Studio\MyProjects\ActionGameV2\ActionGameV2.cpp(21 ) : error C2448: '<Unknown>' : function-style initializer appears to be a function definition
C:\Program Files\Microsoft Visual Studio\MyProjects\ActionGameV2\ActionGameV2.cpp(45 ) : error C2065: 'bulletsort' : undeclared identifier



LinkBack URL
About LinkBacks


