#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 = ;
r = j;
j = ; i = ;
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 ;
}

c++ reference can not be reassigned的更多相关文章

  1. What are the differences between a pointer variable and a reference variable in C++?

    Question: I know references are syntactic sugar, so code is easier to read and write. But what are t ...

  2. [Python Essential Reference, Fourth Edition (2009)]读书笔记

    Python programs are executed by an interpreter. When you use Python interactively, the special varia ...

  3. ERROR: Found lingering reference file hdfs

    Found lingering reference异常 ERROR: Found lingering reference file hdfs://jiujiang1:9000/hbase/month_ ...

  4. ASP.NET Core: You must add a reference to assembly mscorlib, version=4.0.0.0

    ASP.NET Core 引用外部程序包的时候,有时会出现下面的错误: The type 'Object' is defined in an assembly that is not referenc ...

  5. 【转】Django Model field reference学习总结

    Django Model field reference学习总结(一) 本文档包含所有字段选项(field options)的内部细节和Django已经提供的field types. Field 选项 ...

  6. (转) Qt 出现“undefined reference to `vtable for”原因总结

    由于Qt本身实现的机制所限,我们在使用Qt制作某些软件程序的时候,会遇到各种各样这样那样的问题,而且很多是很难,或者根本找不到原因的,即使解决了问题,如果有人问你为什么,你只能回答--不知道. 今天我 ...

  7. undefined reference to `__android_log_print'

    使用android studio 编写NDK代码时出现错误:undefined reference to `__android_log_print' 解决办法: eclipse       andro ...

  8. CentOS 6.5 编译 PHP-7 报错:undefined reference to `libiconv_open 无法编译 PHP libiconv

    ./configure --with-mysql=/backup/mysql --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zli ...

  9. Qt - 错误总结 - 在自定义类头文件中添加Q_OBJECT 编译时报错(undefined reference to ‘vtable for xxThread)

    错误提示:在添加的QThread子类头文件添加Q_OBJECT时,编译程序,出现"undefined reference to 'vtable for xxThread'"错误提示 ...

随机推荐

  1. Git bash 终止git log 命令

    Git bash中 可以通过键入: q ,结束该命令.

  2. .Net Core SignalR 初体验

    前言 Asp.Net SignalR已经出来很久了,但是一直没有静下心来好好看看.昨天花了几个小时的时间看了下.首先借鉴了官方文档,如何搭建一个SignalR的Demo. 参考文章:https://d ...

  3. js 获取后台数据分页

    页面创建一个存放内容的容器,以及分页的容器: <div id="content"></div> <div id="pager"&g ...

  4. 自动化构建工具grunt的学习

    关于grunt的一些记录,记的比较乱... 0.删除node_modules文件夹 命令行: npm install rimraf -g //先运行 rimraf node_modules //然后运 ...

  5. Spring自定义注解(验证身份证+性别+地区)

    第一步:定义注解 PersonFormId: package com.wbg.maven1128.demo_formatter; import java.lang.annotation.*; @Doc ...

  6. 【洛谷P1373】小a和uim之大逃离

    小a和uim之大逃离 题目链接 因为每次只能向下或向右走,我们可以递推 dp[i][j][d][0/1]表示走到(i,j),mod k 意义下差值为d,轮到小a/小uim操作时的方案数 dp[i][j ...

  7. HDU 1014 Uniform Generator(模拟和公式)

    传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1014 Uniform Generator Time Limit: 2000/1000 MS (Java ...

  8. 控制DIV中的文字绝对居中

        水平居中:<div align="center">Content</div>       垂直居中:<div style="line ...

  9. youku客户端

    文件结构 config import os IP_PORT = ('127.0.0.1',8080) BASE_DIR = os.path.dirname(os.path.dirname(__file ...

  10. Change runlevel on CentOS 6.9/CentOS 7.5

    1:CentOS 6.9 # 0 - halt (Do NOT set initdefault to this) # 1 - Single user mode # 2 - Multiuser, wit ...