Code:
int main()
{
printf(" Calculation Engine\n Ready...\n\n");
char buf[BUFSIZ];
char *p;
while (1) {
As given, implemented, and all if branches as contained after the squiggly bracket shown above.
Code:
if ( directory == 0 )
{
printf("\n\nOperation Table -\n\n - 1: Addition etc");
}
The above if branch works perfectly, the loop will continue infinitely, providing the user inputs 'directory', and then presses 'y' to repeat.
Code:
else if ( variable == 0 )
{
float iadd1, iadd2;
printf("\nOperation: Addition\n\n >: First Number: ");
scanf("%f", &iadd1);
printf(" >: Second Number: ");
scanf("%f", &iadd2);
addition( iadd1, iadd2 );
}
This however, does not. Removing everything below the 'first number' printf() line allows it to work, as with all other branches. The scanf() is messing it up, but I'm not sure how...