refPoint 别名与指针

// refPoint.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main(int argc, char* argv[])
{
    int i=2,j=3;
    int *p=&i;
    int &r=*p;
    printf("%d\n",r);
    p=&j;
    printf("%d\n",r);
    return 0;
}
/*
2
2
Press any key to continue
*/

 

posted @ 2017-05-02 13:59  sky20080101  阅读(325)  评论(0编辑  收藏  举报