Hello I'm working on a project for a school presentation, The program is not really finished but 1 module is causing a linker error , "LNK1120 Unresolved external" and I'm unable to find why.
Code:
void CalSpeed(CAR cars[] , int count)
{
int i;
float slopeRad;
float slopeTangent;
printf("MODEL\tSKIDLENGTH\tROADSLOAP\tSPEED\n");
for(i = 0; i < count; i++)
{
slopeRad = cars[i].roadslope * pi / 180;
slopeTangent = sin(slopeRad) / cos(slopeRad) ;
Speed[i] = sqrt(30 * cars[i].skidlength * (slopeTangent + brakefactor));
printf("%s\t%d\t%d\t%.2f\n", cars[i].carmodel , cars[i].skidlength , cars[i].roadslope , Speed[i]);
}
}
Here is the prototype for the module
Code:
void CalSpeed(CAR cars[] , int count);
And its call is at the end of this function:
Code:
void readValues(){
int x = 0;
char correct[3];
char test[50];
while(!feof(stdin))
{
printf("Enter A cars information below Enter ctrl + Z to end entry\n\n");
printf("\n\t\t===================================\n\n\t\t ENTRY WINDOW \n\n\t\t===================================");
fflush(stdin);
printf("\nEnter car model=>");
fgets(car[x].carmodel , 50 , stdin);
if(feof(stdin))
break;
printf("\nEnter the skid length of car=>");
fgets(test , 50 , stdin);
check(test);
car[x].skidlength = atoi(test);
while (car[x].skidlength <= 0)
{
system("cls");
allegro_message("INVALID. Enter a skid length greater than 0");
printf("Enter skid length => ");
fgets(test , 50 , stdin);
check(test);
car[x].skidlength = atoi(test);
}
printf("\nEnter the degree of the road slope=>");
fgets(test , 50 , stdin);
check(test);
car[x].roadslope = atoi(test);
while (car[x].roadslope > 30 || car[x].roadslope < -30)
{
system("cls");
fflush(stdin);
allegro_message("INVALID. Enter a degree > -30 and < +30");
printf("Enter roadsloap => ");
fgets(test , 50 , stdin);
check(test);
car[x].roadslope = atoi(test);
}
system("cls");
printf("Is this information correct? [Y] or [N]:\n\n");
printf("%s: ", "Model");
printf("%s\n" , car[x].carmodel);
printf("%s: " , "Skidlength");
printf("%d\n\n" , car[x].skidlength );
printf("%s: " , "Roadslope");
printf("%d\n\n" , car[x].roadslope );
fgets(correct , 2 , stdin);
correct[0] = toupper(correct[0]);
response_check(correct);
correct[0] == 'N' ? x-- : x++;
system("cls");
}
CalSpeed(car , x -1);
}
If anyone could help it would be most appreciated