954,492 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to flip horizontal an vector array in C ?

Hello World!
i wrote this code for fliping the array , but it doesn't work ...
why can anyone say me ? what i did wrong?
array and i,n variable are already global declared.

void exb(void)
{
    int aux;
    for(i=0;i<(n-1)/2;i++)
    {
        aux=x[i];
        x[i]=x[n-1-i];
        x[n-1-i]=aux;
    }
}


thanks :)

thendrluca
Newbie Poster
4 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
 

Describe your array, and which way you want to "flip" it - Rotate it 90° clockwise or counter-clockwise, or along a particular axis (specify which one). A 3 X 3 example of the array before and after the flip, would be great.

Use code tags around the example, or it will be mangled by the forum software.

Adak
Nearly a Posting Virtuoso
1,479 posts since Jun 2008
Reputation Points: 425
Solved Threads: 185
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: