in function `Graph::file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
main4.cpp:(.text._ZN5Graph4fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN5Graph4fileENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x25): undefined reference to `DisjointSet::DisjointSet()'
collect2: error: ld returned 1 exit status
for initialization in the costructor, call init in constructor?
Sure, you can call init in the constructor. Or just move the code that's in init into the constructor. Whatever you feel is the best organization.
Can you show the current code you have that produces that error?
Show where you declare and implement the DisjointSet constructor. What you are presenting to us does not match what you have in your code, therefore you are not accurately showing your classes (for example, you are attempting to use a function called "file" but no such function exists).
ok i have moved the init code in constructor, now work, thanks.
I have another question related to similar questions,
if I wanted to put a dynamic value in place of MAX,
how should I proceed to then initialize the array?
the dynamic value is in another class