Validação de email em C ++

Ok, então estou tentando criar um programa que permita ao usuário inserir seu email. O email será considerado válido se duas estipulações forem atendidas: A. deve haver um sinal "@" em algum lugar e B. deve haver um período após o "@". Eu obtive o código na maior parte do tempo, mas estou com algumas dificuldades para validar e-mails com um período antes do sinal "@". Se eles tiverem o período antes do sinal "@", serão considerados válidos, mas não devem ser. Por exemplo, digitandotext.example@randomcom é considerado válido.

Alguém pode me ajudar a descobrir o que fiz de errado? Agradeço antecipadamente!

#include <iostream>
#include <cctype>
#include <cstring>
using namespace std;

int main()
{
    int x = 25; //random size enough to hold contents of array plus one for               null terminator
    char input[x]; //array to hold input
    int sizeOf; //holds length of input array
    char* ptr = nullptr; //pointer
    char* ptr2 = nullptr; //pointer

    cout << "Enter your email address\n";
    cin.getline(input,x);
    sizeOf = strlen(input);

    for(int i = 0; i < sizeOf; i++)
    {
        ptr= strstr(input, "@"); //searches input array for "@" string
        if(ptr != nullptr) 
        {
            break;
        }
    }

    for(int i = 0; i < sizeOf; i++)
    {
        ptr2 = strstr(input, "."); //searches input array for "." string
        if(ptr2 != nullptr && &ptr2 > &ptr)
        {
            break;
        }
    }

    if(ptr != nullptr) //validates input of "@" sign
    {
        if(ptr2 != 0 && &ptr2 < &ptr) 
            {
                cout << "Email accepted.\n";
            }

        else
            {
                cout << "Missing . symbol after @\n";
            }
    }

    else
    {
        cout << "Missing @ symbol\n";
    }



return 0;
}

questionAnswers(8)

yourAnswerToTheQuestion