can anyone help me with the above problem?
i need the code in C language.
the problem is:
Store random numbers into two-dimensional array of 6 * 6 and interchange first 3 rows with last three rows
thanks you in advance.
bill13
0
Newbie Poster
Recommended Answers
Jump to PostDo you have any code to show me that u've tried?
a two dimensional array is int blah [][];
there's a start for you!
Jump to Postvoid foo(int a[6][6]) { int i, swap[6]; for (i = 0; i < 3; ++i) { memcpy(swap, a[i], sizeof swap); memcpy(a[i], a[5 - i], sizeof swap); memcpy(a[5 - i], swap, sizeof swap); } }
All 6 Replies
Gnome_101
0
Light Poster
Dave Sinkula
2,398
long time no c
Team Colleague
kalai2790
0
Newbie Poster
kalai2790
0
Newbie Poster
Adak
419
Nearly a Posting Virtuoso
Mohtadeen
0
Newbie Poster
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.