zoukankan      html  css  js  c++  java
  • c++ reference can not be reassigned

    #include <iostream>
     
    using namespace std;
     
    int main () {
       // declare simple variables
       int    i;
       int    j;
       double d;
     
       // declare reference variables
       int&    r = i;
       double& s = d;
       j = 10;
       r = j;
       j = 10;
       
       i = 5;
       cout << "Value of i : " << i << endl;
       cout << "Value of i reference : " << r  << endl;
     
       d = 11.7;
       cout << "Value of d : " << d << endl;
       cout << "Value of d reference : " << s  << endl;
       
       return 0;
    }
    MySQL限时解答,24小时内友哥专业解答
    http://www.yougemysqldba.com
    如有进一步需要请联系微信onesoft007
    微博账号@友哥一指
  • 相关阅读:
    IEnumerator & IEnumerable
    GameObject.Active
    Unity3D的四种坐标系
    gvim
    Platform Dependent Compilation
    delegate
    new 约束
    UIPanel
    UIButton
    UISprite
  • 原文地址:https://www.cnblogs.com/youge-OneSQL/p/9597005.html
Copyright © 2011-2022 走看看