title: stuck in use of vector of structure
body: <p>This is my code. I'm Trying to find max element in this. The Data_Test file is a simple txt file that have 12 data. In my case, 12 number that list one by one below to each other : <code>122 135 148 156 178 189 256 114 125 136 630 360</code>. compiler says that <code>cannot convert 'main()::str' to 'int' in initialization</code>. How can i convert it to <code>int</code>?</p>
  
  <pre><code>ifstream input("Data_Test.txt");
  
  const int NUMstr = 4;
  
  struct str{
  string Data[NUMstr];
  };
  
  str vec;
  vector&lt;str&gt; event;
  
      int maxElementIndex = max_element(event.begin(), event.end()) - event.begin();
      int maxElement = *max_element(event.begin(), event.end());
  
      int minElementIndex = min_element(event.begin(), event.end()) - event.begin();
      int minElement = *min_element(event.begin(), event.end());
  
      cout &lt;&lt; "maxElementIndex:" &lt;&lt; maxElementIndex &lt;&lt; ", maxElement:" &lt;&lt; maxElement;
      cout &lt;&lt; "minElementIndex:" &lt;&lt; minElementIndex &lt;&lt; ", minElement:" &lt;&lt; minElement;
  </code></pre>