#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    38
    Rep Power
    12

    Stupid newbie String question


    I'm going from VC6.0 to 7.0

    Why doesn't this work???

    .mystring.h won't compile ... hates void and string? wha?
    </code>[
    #include <iostream>
    #include <string>

    using namespace System;


    class MyString
    {

    /// Read a string extract either email address or phone

    public:
    MyString();
    ~MyString();
    string ExtractPhoneNumber(String inputline);
    void getRunTime();

    Boolean isEmailAddress(string inputline);
    string IsPhoneNumber(string inputline);
    Boolean isNumeric(string inputline);




    }
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,255
    Rep Power
    2222
    Besides the string type being capitalized in:
    string ExtractPhoneNumber(String inputline);

    it might be complaining about your namespace. I think that string is in the std namespace.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Location
    Flint, MI
    Posts
    328
    Rep Power
    13
    The namespace is definitely part of the problem, but your code should have choked in VC6 as well. I seem to recall VC6 being pretty unforgiving about namespace problems as well.
    Clay Dowling
    Lazarus Notes
    Articles and commentary on web development
    http://www.lazarusid.com/notes/
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    38
    Rep Power
    12
    Thanks guys. It was *both the name space and invalid data types. Not Boolean...back to bool! The msg kept saying:

    >missing ; after method Y!

    thanks for the quick help!

IMN logo majestic logo threadwatch logo seochat tools logo