zoukankan      html  css  js  c++  java
  • 经典编译错误收集

    1class Carton : public Box
    提示一大堆几十个错误,看来是类出了问题,这其实是全角符号和半角符号的区别的问题,将:改为:即可。
    其他还有“与",{}与{}等 。

    2myBox.showVolume;
    提示: statement cannot resolve address of overloaded function
    这是调用成员函数时忘记加括号,应为myBox.showVolume();
    3#include <iosteam>
    using namespace std;
    cout<< "This is a example." << endl;
    提示  iosteam: No such file or directory.
           `cout' undeclared (first use this function) ,
    一个经典的错误,将iostream写错。
    4new types may not be defined in a return type
    two or more data types in declaration of `Draw'
    prototype for `Rectangle Rectangle::Draw()' does not match any in class `Rectangle'
    `Rectangle Rectangle::Draw()' and `virtual void Rectangle::Draw()' cannot be overloaded
    出现四五条错误提示如上,这也是非常常见的错误,原因在于声明了Rectangle类后的}后没有加“;”,然后继续实现 Rectangle::Draw(),  
    5multiple types in one declaration
    此编译错误与上面的第4条类似,也是忘记类声明后忘记加分号,但是在声明的两个类之间 ,中间没有成员函数的实现。
    6cannot resolve overloaded function `precision' based on conversion to type `std::streamsize '
    原语句是 streamsize prec = cout.precision;
    这也是非常容易犯的错误,是调用成员函数时没有加(),上面的语句应为
    streamsize prec = cout.precision();

  • 相关阅读:
    数据库水平切分的实现原理解析---分库,分表,主从,集群,负载均衡器
    现代 PHP 新特性系列(六) —— Zend Opcache
    Apache配置参数详解
    Git的常用命令
    PHP如何防止XSS攻击
    CSRF的防御实例(PHP)
    Web安全之CSRF攻击
    PHP五种常见的设计模式
    PHP四种基础算法详解
    php遍历文件的5种方式
  • 原文地址:https://www.cnblogs.com/xx123/p/10423860.html
Copyright © 2011-2022 走看看