Beispiel #1
0
void polycalcRef(){
    int a = 0;
    int b = 0;
    int c = 0;
    int desc = 0;
    int flag = 1;

    while(flag){
        printf("calcul de racine pour 'ax² + bx + c'\n");
        printf("a = ?\n");
        scanf("%d",&a);
        printf("b = ?\n");
        scanf("%d",&b);
        printf("c = ?\n");
        scanf("%d",&c);

        descriminantRef(&a,&b,&c,&desc);
        testRef(&a,&b,&desc);

        trace(a,b,c);

        printf("stop ? use 0\n");
        scanf("%d",&flag);
        fflush(stdin);
        system("cls");
    }
}
Beispiel #2
0
int main() {
    {
        //test with ptr false
        testRef(NULL);
        testConstRef(NULL);
        testValue(NULL);
    }

    A* x = new A();
    {
        //test with ptr true
        x->x=2;
        testRef(x);
        testConstRef(x);
        testValue(x);
    }
    delete x;
    return 0;
}