c3876 error i cant understand why

Dec 21, 2013 at 7:16pm
Write your question here.
why does this code gets an error c3876??
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#include <iostream>
#include <string>
using namespace std;



class circle {
public:
	float radios;
	int midx,midy;
    float pi;
	
    public:
		circle(int x, int y);
		circle(int x,int y,float radios);
		int getx();
		int gety();
		void setx(int x);
		void sety(int y);
		float area(float radios){return pi*(radios*radios);};
		float circ(float radios) {return 2*pi*radios;};
		void axiscut();
};

circle::circle(int x, int y)
{
	pi=3;
	midx=x;
	midy=y;
	radios=1;
}

circle::circle (int x, int y, float radios)
{
	pi=3;
	midx=x;
	midy=y;
	this->radios=radios;
}

int circle::getx(){
	return midx;
}


int circle::gety(){
	return midy;
}

void circle::setx(int x){
	midx=x;
}

void circle::sety(int y){
	midy=y;
}
	
void circle::axiscut(){
	if (midx==0||midy==0)
		cout<<"theres a cut"<<endl;
	else
	    cout<<"no cut with any of the axis"<<endl;
}



int main() 
{
	circle c1(5,6,8.5);
	
	c1.axiscut;
	
	
		
};


Dec 21, 2013 at 7:29pm
What's the point of having pi as a float, when you assign an integer to it?
Also, why write setters and getters for class that has public member variables?
Also, main should return some value, and shouldn't end with semicolon.
What does compiler say exactly?
Last edited on Dec 21, 2013 at 7:29pm
Dec 21, 2013 at 7:35pm

the pi assign was just a test for something else i tried checking..ignore it,same for the public at the top..
this is the exact message i get:
"Error 1 error C3867: 'circle::axiscut': function call missing argument list; use '&circle::axiscut' to create a pointer to member"
Dec 21, 2013 at 7:40pm
Oh, that's a silly one.

simply write:
c1.axiscut();

instead of
c1.axiscut;

:)
Last edited on Dec 21, 2013 at 7:46pm
Dec 21, 2013 at 7:50pm
its always the small things:)...thx very much!
Topic archived. No new replies allowed.