Request for member '...' in '...' which is of non-class type

So I am just starting Object oriented programming and I am still a bit shakey on a few things. The biggest is ths error: "request for member ‘setRadius’ in ‘checker’, which is of non-class type ‘Circle()’" I haven't the faintest clue how to fix this and it occurs for checker.getRadius and checker.area as well. What am I doing wrong?

Main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <string>
#include "Circle.h"
using namespace std;


int main ()
{
	double rad = 0;
	cout << "Welcome!\n";
	cout << "Please enter a radius for your circle: ";
	cin >> rad;
	Circle checker();
	checker.setRadius(rad);
	cout << endl << "Radius: " << checker.getRadius() << endl;
	cout << "Area: " << checker.area() << endl;
	return(0);
}

Circle.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  #include "Circle.h"

Circle::Circle()
{
	radius = 0.000;
}
void Circle::setRadius(double r)
{
	radius = r;
}
double Circle::getRadius() const
{
	return (radius);
}
double Circle::diameter()
{
	double diam = 2*radius;
	return (diam);
}
double Circle::area()
{
	double pi = 3.14159;
	double a = pi*radius*radius;
	return (a);
}
double Circle::circumference()
{
	double pi = 3.14159;
	double circ = 2*pi*radius;
	return (circ);
}
Circle::~Circle()
{
	
}	

Circle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  #include <iostream>
#include <string>

using namespace std;

#ifndef Circle_h
#define Circle_h

class Circle
{
	public:
		double newDiam, newArea, newCirc;
		//Default Constructor
		Circle();
		//Destructor 
		~Circle();
		//Accessor Functions
		double diameter();
		double area();
		double circumference();
		double getRadius() const;
		void setRadius(double);
	
		private:
		//Member Variables
		double radius;
};

#endif 
Well, checker is the prototype of a function that returns Circle. Remove () or replace them with {}.
That was the simplest solution to a stupid problem thanks a bunch!
Topic archived. No new replies allowed.