获取指向指针的指针的元素(C ++)

时间:2018-09-25 10:59:50

标签: c++ pointers

这是我编写的代码:

#include <iostream>

using namespace std;
struct working{
    int*pointer;
    int inf;
};

int main()
{
  working one;
  working *two;
  working **three;
  one.inf=5;
  one.pointer=NULL;

  two=&one;
  cout<<two<<endl;
  cout<<two->pointer<<endl;
  cout<<two->inf<<endl;

  three=&two;
  cout<<three<<endl;
  cout<<three->pointer<<endl;

  return 0;
}

如何像我对inf所做的操作一样,从pointer获得threetwo元素? 而且,如果可以的话,您能告诉我*three=two做什么。如果我用three=&two切换它,为什么不编译呢?

1 个答案:

答案 0 :(得分:1)

public class HttpHandshakeInterceptor implements HandshakeInterceptor {

      @Autowired
      private IArticleService articleService; // is null

      @Autowired
      private UserDAO userDAO; // is null

    public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception ex) {

    }