base operand of '->' has non-pointer type 'const Comple

->操作符前面的操作数类型不是指针类型

错误原因

函数(&对象)

{
 对象名.成员     //正确方式

 对象名->成员     //编译报错  base operand of '->' has  non-pointer type .......

}

引用传递的参数应该理解为对象,而不是指针

base operand of '->' has non-pointer type 'const Comple的更多相关文章

  1. c/c++ 重载 数组 操作符[] operator[ is ambiguous, as 0 also mean a null pointer of const char* type.

    // Note: //int x = a[0].GetInt(); // Error: operator[ is ambiguous, as 0 also mean a null pointer of ...

  2. 力扣 报错 runtime error: load of null pointer of type 'const int'

    runtime error: load of null pointer of type 'const int' 要求返回的是int* 解决方案 1.指针使用malloc分配空间 用 int * p = ...

  3. puts函数出现warning: passing argument 1 of ‘puts’ from incompatible pointer type(警告:从不兼容的指针类型传递“puts”的参数1)

    代码: /************************************************************************* > File Name: ptr_v ...

  4. caffe: fuck compile error again : error: a value of type "const float *" cannot be used to initialize an entity of type "float *"

    wangxiao@wangxiao-GTX980:~/Downloads/caffe-master$ make -j8find: `wangxiao/bvlc_alexnet/spl': No suc ...

  5. 解决:function in namespace ‘std’ does not name a type + allocator_/nullptr/dellocator_ was not declared + base operand of ‘->’ has non-pointer type ‘std::vector<cv::Mat>’ 错误编译时报错(caffe)

    解决方法,用到了c++11,g++命令需要加上-std=c++11选项 附:g++默认的c++标准 gcc-6.4.0 gcc-7.2.0 默认是 -std=gnu++14gcc-4.3.6 gcc- ...

  6. [踩坑记录] runtime error: load of null pointer of type 'const int' (leetcode)

    leetcode上面做题遇到的错误 原因: 在调用函数时,如果返回值如果是一个常量则没问题.如果返回值若为指针则可能会出现该错误,假如返回的指针地址指向函数内的局部变量,在函数退出时,该变量的存储空间 ...

  7. C++ Error C2662 cannot convert 'this' pointer from 'const *'

    ---恢复内容开始--- 这个错误在于一点:常量对象只能调用常量成员(函数\变量),不能调用非常量成员.另一方面,非常量对象,既可以调用常量成员,又可以调用非常量成员. class A { publi ...

  8. warning: assignment from incompatible pointer type [enabled by default]

    kernel 编译产生这个警告的原因是 不兼容指针类型的赋值 这个原因很有可能是因为返回值和正在接受这个指针类型名不相同. // vim arch/arm/mach-omap2/usb-host.c ...

  9. vue----分级上传

    <template> <div class="page"> <div id="filePicker">选择文件</di ...

随机推荐

  1. C# WinForm 实现窗体淡入淡出

    有时候我们需要给窗体的打开和关闭添加点动画效果.最近正好有这类需求,于是研究了下窗体的淡入淡出,很简单就实现了,这里发表下成果,以供朋友们使用. 在Windows,有一个API,可以设置窗体的可见度, ...

  2. [java,2017-05-04] 创建word文档

    package test; import java.text.SimpleDateFormat; import java.util.Date; import com.aspose.words.Data ...

  3. Android单元测试学习(一)

    什么是单元测试 首先总结一下什么是单元测试,单元测试中的单元在Android或Java中可以理解为某个类中的某一个方法,因此单元测试就是针对Android或Java中某个类中的某一个方法中的逻辑代码进 ...

  4. DRF框架之 serializers 序列化组件

    1. 什么是序列化,其实在python中我们就学了序列化工具json工具,就是吧信息存为类字典形式 2. DRF框架自带序列化的工具: serializers 3. DRF框架 serializers ...

  5. c++之&

    转自www.cnblogs.com/Mr-xu/archive/2012/08/07/2626973.html 一直以为&是取地址,也看到引用,但是今天才发现引用跟取址完全不是一个意思,&am ...

  6. html 提取 公用部分

    在写HTML时,总会遇到一些公用部分,如果每个页面都写那就很麻烦,并且代码量大大增加. 网上查询了几种方法: 1.es6 的 embed 标签. <embed src="header. ...

  7. 大数据spark学习第一周Scala语言基础

    Scala简单介绍 Scala(Scala Language的简称)语言是一种能够执行于JVM和.Net平台之上的通用编程语言.既可用于大规模应用程序开发,也可用于脚本编程,它由由Martin Ode ...

  8. scrapy爬虫框架处理流程简介

    1.SPIDERS的yeild将request发送给ENGIN2.ENGINE对request不做任何处理发送给SCHEDULER3.SCHEDULER( url调度器),生成request交给ENG ...

  9. 二十、Flyweight 享元模式

    原理: 代码清单: BigChar public class BigChar { //字符名称 private char charname; //大型字符 # . \n 组成 private Stri ...

  10. Pandas数据的去重,替换和离散化,异常值的检测

    数据转换 移除重复数据 import pandas as pd import numpy as np from pandas import Series data = pd.DataFrame( {' ...