I have a need to convert/upgrade my data structure struct to a class and have a question:
Can I statically initiate my class like the struct? If so, any guidance of how to do it would be highly appreciate.
Below is the definition of my struct:
typedef struct t
{
struct t *next;
int otherfield;
} T
T r1[]={{0,1},{0,2}};
T s1[]={{r1,3},{0,4}};
My converted class looks like
class T
{
class T next;
int otherfield;
}
List<T> r1;
List<T> s1;
How do I statically initiate r1, s1. Standard initialization thru a constructor may not work as I have hundred of these struct and they were all initialized statically.
Thanks,
Can’t you just do the following?
Edit: if you want to do it with a List then you could do the following: