Hi everyone,
I have written a program which works OK when I build and run it as a multi-threaded debug DLL, but when I try and change the option in the 'code generation' menu to multi-threaded debug, I get some error messages and the project will not build. Here is my code - what am I doing wrong?
Code:#include <iostream> #include <cmath> #include <conio.h> using namespace std; int main (){ float a; float b; float c; float xone; float xtwo; int roots; float discriminant; float topline1; float topline2; float bottomline; char name[50]; char ch; cout << "\nWelcome to the quadratic equation solver. Please enter your name:" << endl; cin.getline(name, 50); start: system("cls"); cout << "\nHello " << name << ". Please enter the X-squared coefficient (a):" << endl; cin >> a; system("cls"); cout << "\nEnter the X coefficient (b):" << endl; cin >> b; system("cls"); cout << "\nEnter the final constant (c):" << endl; cin >> c; system("cls"); discriminant = (pow(b, 2))-(4*a*c); topline1 = (b*-1) + (sqrt(discriminant)); topline2 = (b*-1) - (sqrt(discriminant)); bottomline = (2*a); xone = (topline1/bottomline); xtwo = (topline2/bottomline); if (discriminant < 0) roots = 0; else if (discriminant > 0) roots = 2; else if (discriminant == 0) roots = 1; cout << "\nYour two X values are " << xone << " and " << xtwo << " ." << endl; cout << "\nYour discriminant is " << discriminant << " meaning that your number of roots is " << roots << " ." << endl; cout << "\nPress enter to return to the start, or any other key to close.\n" << endl; ch = _getch(); if (ch == 13) goto start; return 0; }



LinkBack URL
About LinkBacks



