#include <iostream>
#include <string>

int main()
{
    const std::string args[1] = { "james.parsons@cplusplus.com" } ;

    auto pos = args[0].find( '@' ) ;
    if( pos != std::string::npos )
    {
        const std::string user = args[0].substr( 0, pos ) ;
        const std::string host = args[0].substr( pos+1 ) ;
        std::cout << "user: " << user << "  host: " << host << '\n' ;
    }
}
