#include <iostream>
using namespace std;
class PrintName{
public:
void studentName(){
cout<<"Name : "<<studentName<<endl;
}
};
class MathClass{
public:
void multiplicationFunc(int x, int y){
cout<<"Result : "<<(x*y)<<endl;
}
};
int main()
{
cout<<endl;
PrintName PN;
PN.studentName("Mark", "Santo");
MathClass MC;
MC.multiplicationFunc(10,5);
}
I am new to C++ and am learning about classes and objects. From what I gathered classes are ways to group functions and objects is the ability to access them? I am having trouble getting this code to work, I receive an error on line 15 for 'error: no match for 'operator<<'. I am trying to fix my class in order for the main function to work. The output should simply be 'Name : Mark Santo' 'Result : 50'
Thank you for your help everyone!