c++关于关于函数调用的问题

#include
#include
#include
using namespace std;
class Plass
{
public:
int fun();
int judge();
private:
int mid;
int flag;
int num;
int sign;
int bott;

};
int main()
{

Plass A;
A.fun();
A.judge();
return 0;
}
int Plass::fun()
{

cout<<"随机生成的数组: ";
srand((int)time(NULL)); //利用时间函数time(),产生不同的随机种子
int a[10];
for(int i=0;i {a[i]=rand()%100+1; //rand()5100用于产生0-99之间的随机数
cout cout cout int temp=0;
//采用冒泡排序给数组a[10]按从小到大排序
for(int i=0;i {
for(int j=i+1;j {
if(a[i]>=a[j])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
continue;
}
else
continue;
}
cout<<a[i]<<' ';
}
cout<<endl;

}

int Plass::judge()
{
//调用fun()函数中的a[10]数组
?????
怎么在这里调用fun()函数中的a[10]数组,实现下面的功能
//判断所输入的数字符不符合要求

int mid=0,sign=0,flag=1,legal=0;

while(flag)
{
    int b;
    cout<<"请再次输入一个正整数用于检测: ";
    cin>>b;
    int i;
 //判断要检查的数在不在数组范围内 
    if(b<a[0]||b>a[9])    
    flag=-1;
    int top,bott;
    top =0;
    bott =10;
    while(sign==0&&(top<=bott))
    {
        {
            mid =(top+bott)/2;
            if(b<a[mid])
              bott=mid+1;
            else if(b>a[mid])
            top = mid-1;
            else if(b==a[mid])
            {
                cout<<d<<"是数组第"<<mid+1<<"个元素"<<endl;
                sign =1;
                break;
            }
        }
    } 
    //判断有无次数并输出 
    if (!sign||flag==-1)
    cout<<"无此数"<<endl;
    char c;
    cout<<"是否考虑重新输入数字(Y/N):";
    fflush(stdin);
    cin>>c;
    if(c=='Y')
    flag=1;
    else
    flag=0;

}

}

把a数组设成Plass的成员变量或者弄成全局变量或者作为fun的返回值都行的

 #include<iostream>
#include<stdlib.h>
#include <time.h> 
using namespace std;
class Plass
{
    public:
        int fun();
        int judge();
    private:
        int mid;
        int flag;
        int num;
        int sign;
        int bott;
        int a[10];

};
int main()
{   
    Plass A;
    A.fun(); 
    A.judge();
    return 0;
} 
int Plass::fun()
{   
    cout<<"随机生成的数组: ";
    srand((int)time(NULL));                        //利用时间函数time(),产生不同的随机种子 
    //int a[10];
    for(int i=0;i<10;i++)
       {a[i]=rand()%100+1;                           //rand()5100用于产生0-99之间的随机数
        cout<<a[i]<<' ';}
    cout<<endl;
    cout<<"排序后数组: ";
    int temp=0;
    //采用冒泡排序给数组a[10]按从小到大排序
     for(int i=0;i<9;i++)
     {
        for(int j=i+1;j<10;j++)
        {
            if(a[i]>=a[j])
            {
            temp=a[i];
            a[i]=a[j];
            a[j]=temp;
            continue;
            }
            else
            continue;
        }
        cout<<a[i]<<' ';
    }
    cout<<endl;
        return 0;
}

int Plass::judge()
{
    //调用fun()函数中的a[10]数组 
    //????? 
    //怎么在这里调用fun()函数中的a[10]数组,实现下面的功能
    //判断所输入的数字符不符合要求

    int mid=0,sign=0,flag=1,legal=0;

    while(flag)
    {
        int b;
        cout<<"请再次输入一个正整数用于检测: ";
        cin>>b;
        int i;
     //判断要检查的数在不在数组范围内 
        if(b<a[0]||b>a[9])    
        flag=-1;
        int top,bott;
        top =0;
        bott =10;
        while(sign==0&&(top<=bott))
        {
            {
                mid =(top+bott)/2;
                if(b<a[mid])
                  bott=mid+1;
                else if(b>a[mid])
                top = mid-1;
                else if(b==a[mid])
                {
                    cout<<b<<"是数组第"<<mid+1<<"个元素"<<endl;
                    sign =1;
                    break;
                }
            }
        } 
        //判断有无次数并输出 
        if (!sign||flag==-1)
        cout<<"无此数"<<endl;
        char c;
        cout<<"是否考虑重新输入数字(Y/N):";
        fflush(stdin);
        cin>>c;
        if(c=='Y')
        flag=1;
        else
        flag=0;

    }
    return 0;
}

图片说明