title: How to solve the error "expression must be a modifiable lvalue" in c++?
body: <pre><code>const int ADJ_MATRIX[VERTEX_NUM][VERTEX_NUM]={   
                                                  {0,1,1,0,0,0,0,0},
                                                  {1,0,0,1,1,0,0,0},
                                                  {1,0,0,0,0,1,1,0},
                                                  {0,1,0,0,0,0,0,1},
                                                  {0,1,0,0,0,0,0,1},
                                                  {0,0,1,0,0,0,1,0},
                                                  {0,0,1,0,0,1,0,0},
                                                  {0,0,0,1,1,0,0,0}
                                              };
  
  typedef struct {
      int vertex;
      int matrix[VERTEX_NUM][VERTEX_NUM];
      int vNum;
      int eNum;
  }Graph;
  
  void buildGraph(Graph *graph){
      graph-&gt;vNum = VERTEX_NUM;
      graph-&gt;eNum = EDGE_NUM;
      graph-&gt;matrix = ADJ_MATRIX;
  }
  </code></pre>
  
  <p>The error occurs in this sentence: </p>
  
  <pre><code>graph-&gt;matrix = ADJ_MATRIX;
  </code></pre>
  
  <p>I am new to c++. please tell me why this problem occur and how to solve it?</p>
  
  <p>I want to assign ADJ_MATRIX to the matrix in <code>struct</code>.</p>