Wow sorry for so many edits I just need to swap the rest of my array of structs along with the day value now delete this post or post insight on how

int x, y;

  for(x = 0; x < l; x++)
    {
          for(y = 0; y < x; y++)
          {
                if(print[x].day > print[y].day)
                {
                  int temp = print[x].day;
                  print[x].day = print[y].day;
                  print[x].day = temp;
                  }
				
			}

Recommended Answers

All 2 Replies

From the google God himself.

The two loops are wrong

for(x = 0; x < l-1; x++)
    {
          for(y = x+1; y < l; y++)
          {
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.