I am getting the address to print out but i want it to return the string that it was given any help will be appreciated.
header
1 2 3 4 5 6 7 8 9 10 11 12 13
#pragma once
#include <iostream>
usingnamespace std;
class A
{
public:
static string function1();
static string function2();
static string bothfunction();
};
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "Header.h";
string A::function1(){
return"starting off in function 1";
}
string A::function2() {
return"NOW in function 2";
}
string A::bothfunction()
{
return"finshed with both of the functions";
}
In main lines 12 - 14 obj.function1 is not a function call. What you need is obj.function1(). An easy mistake to make. My compiler will complain when I leave off the "()".