How would I compare 2 numbers with 2 decimals in them?

How would I compare which number is bigger if the 2 numbers have 2 decimal places instead of just 1? For example 1.33.4 < 3.0.22? The range of the digits between each decimal is 3 that means 3 digits maximum for each number in the decimal places (example 999.999.999 would be the max and 0.0.0 would be the minimum).
How would I compare these two strings? More importantly how would I take the cin and separate the 3 digits into variables by the decimals?

1
2
3
4
5
6
7
  int main()  
{
   cout << compareVersions("1.0", "1.1") << endl;
   cout << compareVersions("2.0", "2.0.1") << endl;
   ...
   return 0;
}
How would I compare which number is bigger if the 2 numbers have 2 decimal places instead of just 1?Copy the string remove the dots and compare the copies.

More importantly how would I take the cin and separate the 3 digits into variables by the decimals?
1
2
3
    int val1, val2, val3;
    char ch;
    std::cin >> val1 >> ch >> val2 >> ch >> val3;
Thank you coder777 that was very helpful and just what I needed.
Topic archived. No new replies allowed.