// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    char ip[] = "111.222.333.444";
    char *p;
    p  = strtok(ip, ".");
    cout << p << endl;
    while((p = strtok(NULL, ".")) != NULL)
    {
        cout << p << endl;
    }
    return 0;
}
