Aug 6, 2018 at 7:57pm UTC
Hello,
I am trying to do a code with a header file, main, and client file. I keep getting recurring errors for a dot operator.
How would I fix this issue?
#include "fraction.h"
#include <iostream>
using namespace std;
// Constructors
fraction::fraction(){
numerator = 0;
denominator = 1;
}
fraction::fraction(int initNumerator, int initDenominator){
if(initDenominator == 0){
std::cout<<"Denominator can not be zero"<<std::endl;
exit(0);
}
numerator = initNumerator;
denominator = initDenominator;
}
The error states it cant be used.
Aug 6, 2018 at 8:52pm UTC
What dot operator? I don't see any use of a dot operator.
Last edited on Aug 6, 2018 at 8:52pm UTC
Aug 6, 2018 at 10:24pm UTC
Every line with the fraction::fraction I get the error " Cannot use dot operator on a type"
Aug 7, 2018 at 1:51am UTC
There is no use of the "dot operator" in the code that you've shown. The dot operator is a single period. Maybe you should show all of your code. Remember to put it in code tags:
[code]
your code goes here
[/code]