#include <iostream.h>
class point{
private:
float x,y;
public:
void f1(float a,float b){
x=a;y=b;
}
void get(){
cout<<a<<b<<endl;
}
};
main(){
point a;
a.f1(2.2,3.3)
a.get();
}
COUT<<A<<B<<ENDL;错误
A,B是F1的形参,在GET()中无法使用。
#include <iostream.h>
class point{
private:
float x,y;
public:
void f1(float a,float b){
x=a;y=b;
}
void get(){
cout<<a<<b<<endl;
}
};
main(){
point a;
#include <iostream.h>
class point{
private:
float x,y;
public:
void f1(float a,float b){
x=a;y=b;
}
void get(){
cout<<a<<b<<endl;
}
};
main(){
point a;
a.f1(2.2,3.3)
a.get();
}
COUT<<A<<B<<ENDL;错误
A,B是F1的形参,在GET()中无法使用。