31 lines
731 B
C++
31 lines
731 B
C++
// myDynamicLibrary.cpp
|
|
|
|
#include "myDynamicLibrary.h"
|
|
|
|
using namespace std;
|
|
|
|
string myDynamicLibrary::sayHelloDynamic()
|
|
{
|
|
string text = "You have given two numbers a ";
|
|
text += to_string(myDynamicLibrary::a);
|
|
text += " and number b ";
|
|
text += to_string(myDynamicLibrary::b);
|
|
text += ".";
|
|
|
|
return text;
|
|
}
|
|
|
|
string myDynamicLibrary::text(){
|
|
return "This is the demo text from the library";
|
|
}
|
|
|
|
int myDynamicLibrary::multiply(){
|
|
return myDynamicLibrary::a * myDynamicLibrary::b;
|
|
}
|
|
|
|
double myDynamicLibrary::devide() {
|
|
if (myDynamicLibrary::b == 0) {
|
|
throw std::runtime_error("Cannot divide by zero!");
|
|
}
|
|
return static_cast<double>(myDynamicLibrary::a) / myDynamicLibrary::b;
|
|
} |