Hi. I need help with arrays. I have problems with three different array-practices.
I'm using Dev-C++ 4.9.9.2
First:
I need to move array's slots one slot to left. (I don't know what they are called in english, english isn't my native language)
For example, if I'd make array a[10], how I could make it so that a[0] becomes a[1], a[1] becomes a[2]... and finally a[9] becomes a[0]?
Second:
How can I use "char" in array? I know how to make a[3][3] cout numbers like this:
1 2 3
4 5 6
7 8 9
But when I tried to use char "a[3][3]" and input something like {"a", "b", "c"} it didn't work...
Third:
How to swap rows and collumns?
For example, if I had int a[3][3] = {{1,2,3},{4,5,6},{7,8,9}}; How to make it like this:
1 2 3 ------- 1 4 7
4 5 6 ------- 2 5 8
7 8 9 ------- 3 6 9
^^^these collums become rows
I tried to google these but couldn't find anything. I'd appreciate any help.
you want to everything to the left? just create a temporary variable to store of value and switch the values around, do this with a for loop. using if statement when you get to the last element.
I can't post any code because I am at work.