title: Static member modification in const member function in C++
body: <p>I am working on linked-list but can't modify the value of current pointer in const function "void Print() const"</p>
  
  <p>In the function Print I want to do <b>"current= head"</b> &amp; then increment like <b>"current=current->link"</b> but can't do so, bcz it is showing that</p>
  
  <p><b>"error C3490: 'current' cannot be modified because it is being accessed through a const object   e:\Cpp\projects\data structure ass-1\data structure ass-1\source.cpp    83  1   Data Structure Ass-1
  "</b></p>
  
  <pre><code>#include&lt;iostream&gt;
  
  struct node
  {
      int data;
      node *link;
  };    
  
  class List
  {
      node *head,*current,*last;
  public:
      List();
  //  List(const List&amp;);
  //  ~List();
  
  void print() const;
  
  };
  
  using namespace std;
  
  int main()
  {
      List List1;
  }
  
  void List::print() const
  {
       current=head;   //here is my error
       current=current-&gt;link;
  }
  
  List::List():current(head)
  {
  
  }
  </code></pre>