I don't understand exactly what you are asking, but the dot operator in C is only used to access the members of an object. You can not make it do anything other than that. Not even C++ allow overloading the dot operator.
you can make a linked list of linked lists. in c++ its easier and cleaner with templates. in C you might have either 2 list objects (one of data and one of lists of data) or a generic one that stores void*s. If its void* generic you access the data by casting all the pointers back, which would be rather messy, and your find/delete/etc methods need some way to know what to cast to so they can take a look. And the list of lists needs some sort of ID field on each list as well, of course.
and finally you could create a 2-d like structure in a single object that was internally a list of lists.
All in all this seems like a weird and less than useful design. To me it feels like an array (or pointer) of lists is more useful, if you need many, where each one has a fixed location you can jump to (remember the list ID? Now its the array/pointer offset index). But maybe you have an interesting problem where it makes sense to list the outside instead? I could see it also where you would not have search/delete/etc type functions, like a list used for a stack, queue, etc and you only work of the endpoints.
struct Node {
int value;
Node* next {};
};
struct NestNode {
Node* valp {};
NestNode* next {};
};
NestNode head = ...
head->next->valp->value = 42; // A
(*head).(*next).(*valp).value = 42; // B
Both A and B do assign a value to (existing) first element of second list of the nest pointed to by the head.
The latter does use the dot operator.
The struct definition syntax does differ in C. (Can't recall how.)
My C is rusty, but some pseudocode..
struct node //c needs a typedef, c++ makes this a type directly.
{
void* data;
int ID;
node* next;
};
void add(node &head, void* d)
{
staticint id = 1;
... add to the list here
}
node *outerlist = malloc(..)
node *innerlist1 = malloc(...
for(whatever)
{
add(innerlist1, something);
}
add(outerlist,innerlist1);
... repeat for innerlist2..3..4..n
and later.. heh.. is where it gets unfriendly you will get something like this..
(data*)(find(((node*)(find(outerlist, idnum))),id))
to get say an integer (data* means int* in that case) from one of the inner lists...
do you see how much easier it is to instead say (if you can)
node* outer[numlists];
for(i = ..numlists)
for(items in each list..)
add(outer[i], item)
nesting the lists is going to be an exercise in frustration and if you can possibly avoid that, do so... the answer is that yes its possible, but maybe you should try to find another way before going there.