Protection of class and datas.

Protection of class and datas.

const

See version :

Pas de dépendances

Download :

class test
{
private:
    int x;
public:
    test(){}
    char* fonc(int a);
    void fonc2(int* b);
    void fonc3(int& d);
};

char* test::fonc(int a) 
{
    x=a;  // 1
    a++;  // 2
    return "plouf";
}

void test::fonc2(int* b)
{
    *b = 5; // 3
    b++;    // 4
}

void test::fonc3(int& d)
{
    d=6;  // 5
}

int main()
{
    int table[3];
    int c = 5; 
    c=c+1;  // 6
    char* paf;
        
    table[0]=7;
    table[1]=13;
    table[2]=21;
    
    test t;
    paf=t.fonc(6);
    t.fonc2(&(table[0]));

    paf[0]='V';  // 7

    t.fonc3(c);

    return 0;
}





Explanations

	No explanations yet.