I am studying the creation of classes in C + +. When executing the code below the method LEN class String2 not work. Someone can tell me why?

code ----------------------------------------------------------------------------------------------
#include <iostream>
#include <string.h>
using namespace std;

const int MAX = 80;

class string2
{
private:
char str[MAX];
public:
string2() {str[0]='\0';}
string2(char s[]) {strcpy_s(str,s);}
string2(char ch, int n);
int len() const {return strlen(str);}
void print() const {cout << str;}
};

string2::string2(char ch, int n)
{
int ii;
for(int i=0;i<n;i++)
{
str[i] = ch;
ii = i;
}
str[ii] = '\0';
}
void main()
{
string2 s1("Feliz Aniversario! "),
s2('=',18),
s3 = "Estamos na Primavera. ",
s4,s5;
cout << "\nS1 = "; s1.print();
cout << "\nS2 = "; s2.print();
cout << "\nS3 = "; s3.print();

s4 = "O Mundo gira!";

cout << "\nS4 = "; s4.print();

s5 = s4;

cout << "\nS5 = "; s5.print();

cout << "\nTamanho de S1: "; s1.len();
cout << "\nTamanho de S2: "; s2.len();
cout << "\nTamanho de S3: "; s3.len();
cout << "\nTamanho de S4: "; s4.len();
cout << "\nTamanho de S5: "; s5.len();
}