Objects and Classes - Programming

Q1:

What will be the output of the following program?
#include<iostream.h>
#include<string.h> 
class AptitudeCrack
{
    char str[50]; 
    char tmp[50]; 
    public:
    AptitudeCrack(char *s)
    {
        strcpy(str, s);
    }
    int AptitudeFunction()
    {
        int i = 0, j = 0; 
        while(*(str + i))
        {
            if(*(str + i++) == ' ')
                *(tmp + j++) = *(str + i);
        }
        *(tmp + j) = 0; 
        return strlen(tmp); 
    }
};
int main()
{
    char txt[] = "Welcome to AptitudeCrack.com!";
    AptitudeCrack objAptitude(txt); 
    cout<< objAptitude.AptitudeFunction();
    return 0;
}

A 1

B 2

C 24

D 25

ANS:B - 2

No answer description is available. Let's discuss.