This code should be changed to look like:
compito.h

#include <iostream>
#include <cstring>
// using namespace std; - it should be removed!

const int DIM = 3;
...
};