Write a function in C++ which accepts an 2d array and its size as arguments/parameters and exchanges the values of first half side elements with the second half side elements of the array.

Recommended Answers

All 3 Replies

Very simple u can swap them by using any third array type variable.

Show us what you've written so far, and we'll try to help you get it working.

Can you write a 'prototype' for the function?

(That could get you started?)

Be a part of the DaniWeb community

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