title: I am very confused on how to parse multiple delimiters using getline and strtok in c++
body: <p>My code is posted below. I want to be able to parse using the delimiters " ()," and convert the strings into integers in cpp.</p>
  
  <pre><code>while(getline(fin, line))
  {
      x  = atoi((strtok(line.c_str(),'(,)'));
      xx = atoi((strtok(NULL,"(),"));
      xxx = atoi((strtok(NULL,"(),")));
      cout &lt;&lt; x &lt;&lt; "    " &lt;&lt; xx &lt;&lt; "    " &lt;&lt; xxx &lt;&lt; "\n";
  }
  </code></pre>
  
  <p>but for some reason I get the following errors</p>
  
  <p>GraphTest.cpp:134: error: invalid conversion from ‘const char*’ to ‘char*’</p>
  
  <p>GraphTest.cpp:134: error:   initializing argument 1 of ‘char* strtok(char*, const char*)’</p>
  
  <p>The .c_str should convert my string into a c type string allowing me to use the atoi and strtok functions. I am very confused and would appreciate any help.</p>