[ create a new paste ] login | about

Link: http://codepad.org/nEINUhJI    [ raw code | output | fork ]

C++, pasted on Dec 3:
#include <stdio.h>

int *Calc( int *pFact )
{
    *pFact = 30;
    return pFact;
}

void Func( int **ppIn )
{
    printf( "%d" , **ppIn );
}

int main( void )
{
    int *pHoge = NULL;
    pHoge = new int(10);
    
    Func( &(Calc( pHoge )) );

    return 0;
}


Output:
1
2
3
In function 'int main()':
Line 19: error: invalid lvalue in unary '&'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: