I have a weird line printing and cant find it

I know this is a simple mistake but I think I am snow blind at this point. I am getting a "garbage out line " at the head of my second print function. Any ideas?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <cstdlib>
#include <ctime>
#include <iostream>


using namespace std;

void print(char [][16]);
void sortColumn(char a[][16]);
int main(int argc, char** argv) {
    
    
    char a[10][16] = {{'L', 'c', 'e', 'k', 'o', 'e', 'd', 'd', 'h', 'o', 'f', 'f', 'b', 'm', 'b'},
{'L', 'k', 'c', 'm', 'g', 'g', 'j', 'c', 'd', 'h', 'h', 'g', 'l', 'i', 'f'},
{'C', 'g', 'l', 'd', 'j', 'h', 'c', 'e', 'k', 'j', 'i', 'g', 'c', 'd', 'd'},
{'C', 'g', 'l', 'd', 'j', 'h', 'c', 'e', 'k', 'j', 'i', 'g', 'c', 'd', 'n'},
{'B', 'f', 'f', 'm', 'd', 'b', 'k', 'c', 'e', 'n', 'l', 'a', 'f', 'j', 'k'},
{'F', 'g', 'g', 'd', 'i', 'j', 'i', 'j', 'e', 'g', 'f', 'b', 'l', 'l', 'n'},
{'J', 'j', 'l', 'n', 'c', 'n', 'i', 'm', 'j', 'l', 'd', 'f', 'e', 'd', 'j'},
{'A', 'm', 'l', 'i', 'g', 'l', 'f', 'o', 'h', 'a', 'j', 'c', 'd', 'm', 'm'},
{'B', 'a', 'l', 'g', 'f', 'c', 'a', 'e', 'l', 'h', 'f', 'k', 'g', 'e', 'b'},
{'K', 'm', 'l', 'h', 'm', 'h', 'c', 'd', 'd', 'f', 'o', 'e', 'i', 'l', 'd'}};
    //char temp[][6];
    print(a);
    cout<<endl;
    sortColumn(a);
    print(a);

 return 0;   
}

void print(char a[][16]){
    for(int i=0;i<10;i++){
        cout<<a[i]<<endl;
    }

}
void sortColumn(char a[][16])
{
    char n=0;
 for(int x=0; x<256;x++)
       
    {
       
            for(int i=0;i<10;i++)
            {    
                
               if(a[i][n]<a[i+1][n])
                    { 
                        for(int z=0;z<16;z++)
                        {

                        char temp[10][16];
                        temp[i][z]=a[i][z];
                        a[i][z]=a[i+1][z];
                        a[i+1][z]=temp[i][z];

                        }
                    }
                    

            }
        
    }
}
I can't see a garbage line either...
Topic archived. No new replies allowed.