zoukankan      html  css  js  c++  java
  • c++ arrow operator ,, –> Operator,,,指针专属 GIS

    C++ has an operator that can be used with a pointer to simplify the notation for
    specifying the members of a struct or a class. The arrow operator , -> , combines
    the actions of a dereferencing operator, * , and a dot operator to specify a member of
    a dynamic struct or class object that is pointed to by a given pointer. For example,
    suppose you have the following definition:
    struct Record
    {
    int number;
    char grade;
    };
    The following creates a dynamically allocated variable of type Record and sets the
    member variables of the dynamic struct variable to 2001 and 'A' .
    Record *p;
    p = new Record;
    p->number = 2001;
    p->grade = 'A';
    The notations
    p->grade
    and
    (*p).grade
    have the same meaning. However, the first is more convenient and is almost always the
    notation used.

  • 相关阅读:
    java 8
    内存溢出VS内存泄漏
    dubbo zk 分布式服务项目搭建与配置
    转发 VS 重定向
    过滤器
    Synchronized
    java 泛型
    spring 整合 mongo
    泛型
    反虚拟机
  • 原文地址:https://www.cnblogs.com/gisbeginner/p/2746328.html
Copyright © 2011-2022 走看看