struct tmp{ bool charset[256]; .. void include(char ch){ charset[ch] = true; } .. } tcharset tcharset_union(tcharset a, tcharset b){ tcharset tmp; for (unsigned int i=0;i<256;i++){ if (a.checkchar(i) || b.checkchar(i)){ cout << "union" << endl; //tmp.include(char(i)); } } return tmp; }