Struct, the method uses data from struct

#1

Will you help me, how the method can access to struct data?
For instance:

struct DF{Td}
data::Td
function square()
return data^.2
end
end

0 Likes

#2

It seems you are trying to use Julia like C++, but it is a very different language. You may want to read the manual, at least up to “Methods”.

(Please quote your code).

5 Likes