sorting of 2d arrays in C

i'm a beginner in c. and a little bit confused about 2-d arrays which was pretty easy in python. let's suppose i declare an array[100][2] and take their readings. then i want to sort the elements through one dimension only. if i couldn't make myself clear, here's the code which runs perfectly in python(this logic). but in c, it gives error while sorting. int array[100][2],i,j,n=50,temp[1][2]; for(i=0;ilist[i][1]){ temp=list[i]; list[i]=list[j]; list[j]=temp; } } } so what should be the correct approach in C? if you haven't understand my question, please comment!
You cannot assign array in C. If you want, you can declare a struct. Otherwise, you need to assign the 2 numbers one by one.

以上就是sorting of 2d arrays in C的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准