Example #1
0
int main(){
    Child child;
    cout << child.foo() << endl;
    
    int arr[] = {10,20,30,40,50,60};
    int *ptr1 = arr;
    ++*ptr1;
    int *ptr2 = arr+5;
    cout << "--> "<<*ptr1 << endl;
    cout << "--> "<<(char*)ptr2  - (char*)ptr1 << endl;

    f(&i,&j);
    cout << i <<" "<< j << endl;
    test(arr);
    int size= (int)sizeof(arr)/sizeof(arr[0]);
    cout << "Size here: " << sizeof(arr[0]) << endl;
    //x = (char *)a;
    ///cout <<"here " << x << endl;
//    Tiger tiger;
//    Animal animal;
//    animal.print();
//    animal.vPrint();
//    tiger.print();
//    tiger.vPrint();
//    Animal *a = &animal;
//    a->print();
//    a->vPrint();
//    a = &tiger;
//    a->print();
//    a->vPrint();
    return 0;
}
int main(int argc, char *argv[])
{
    Child *p = new Child();
    
    p->foo();
    
    delete p;
    p = NULL;

    return 0;
}
Example #3
0
File: main.cpp Project: CCJY/coliru
int main(){
    Parent p;
    Child ch;
    ch.foo(&ch);
    
}