interator check

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Renier
    New Member
    • Aug 2007
    • 4

    interator check

    Hi, I'm new to this interator thing.
    Can I check if a interator != NULL.
    It gives an compiling error on VC8, but not VC6.
    Please assist.
  • gpraghuram
    Recognized Expert Top Contributor
    • Mar 2007
    • 1275

    #2
    Originally posted by Renier
    Hi, I'm new to this interator thing.
    Can I check if a interator != NULL.
    It gives an compiling error on VC8, but not VC6.
    Please assist.
    r u discussing about iterator.
    I havent heard anything like iterator

    Raghuram

    Comment

    • Renier
      New Member
      • Aug 2007
      • 4

      #3
      Yes, sorry iterator. Just trying to get they app to compile on the new compiler and don't want to remove code completely. Any way of checking if the iterator is NULL?

      Comment

      • Meetee
        Recognized Expert Contributor
        • Dec 2006
        • 928

        #4
        Originally posted by Renier
        Yes, sorry iterator. Just trying to get they app to compile on the new compiler and don't want to remove code completely. Any way of checking if the iterator is NULL?
        I think you have taken iterator as a variable and then trying to compile this. Can you paste your code snippet here? Also paste errors if getting any.

        Regards

        Comment

        • Renier
          New Member
          • Aug 2007
          • 4

          #5
          Just a quick sample:

          int main()
          {
          NumberedFieldMa p::iterator m_CurrentField;

          if ( m_CurrentField != NULL )
          {
          cout << "m_CurrentF ield not is NULL" << endl;
          }
          else
          {
          cout << "m_CurrentF ield is NULL" << endl;
          }
          char c = getch();
          return 0;
          }

          I'm not getting any errors as I'm using VC6, but the guy asking me to look at it is using VC8. Something about no conversion for left hand operator. Cant exactly remember the error.(should have written it down) Maybe someone here came accross the same problem.

          Comment

          • Renier
            New Member
            • Aug 2007
            • 4

            #6
            All I actually want to know is can I check if a iterator is NULL. Or is the end() function enough. What if it's trying to get an value out of the scoupe? This is critical code so, I don't want to take any chances.

            Comment

            Working...