C
cmk128
hi
1 #include <stdio.h>
2
3 class A{
4 private:
5 int x;
6 public:
7 A(int x){
8 this->x;
9 }
10
11 A(int x, char *y){
12 A(x); <---------------- may
i know how to fix this line?
13 }
14 };
15
16 int main(){
17 return 1;
18 }
d.cpp: In constructor `A::A(int, char*)':
d.cpp:12: error: declaration of `x' shadows a parameter
d.cpp:12: error: no matching function for call to `A::A()'
d.cpp:3: error: candidates are: A::A(const A&)
d.cpp:11: error: A::A(int, char*)
d.cpp:7: error: A::A(int)
thanks
from Peter ([email protected])
1 #include <stdio.h>
2
3 class A{
4 private:
5 int x;
6 public:
7 A(int x){
8 this->x;
9 }
10
11 A(int x, char *y){
12 A(x); <---------------- may
i know how to fix this line?
13 }
14 };
15
16 int main(){
17 return 1;
18 }
d.cpp: In constructor `A::A(int, char*)':
d.cpp:12: error: declaration of `x' shadows a parameter
d.cpp:12: error: no matching function for call to `A::A()'
d.cpp:3: error: candidates are: A::A(const A&)
d.cpp:11: error: A::A(int, char*)
d.cpp:7: error: A::A(int)
thanks
from Peter ([email protected])