Hi,

I have linkend list in my program and I need to swap two elements.

typedef struct
{
  int day;
  char month[10];
  
} LData;

typedef struct element LElement;

struct element
{
  LData data;
  LElement *next;
}

typedef struct 
{
  TLement *head;
} TLinked;

Then some basic functions - initialization, insert, delete list, reading line etc.

And I need to call function swap(TLinked *list), which will result in swapping two elements in my list.

I hope you understand me. Otherwise I will try to make it clearer. Thanks

I hope you understand me. Otherwise I will try to make it clearer. Thanks

What you forgot to mention is in what way should we help you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.