Code:
printf("Enter your data (5x10) of characters: \n");
for (i = 0; i < SIZE1; i++)
for (j = 0; j < SIZE2; j++)
scanf("%c", &matrix2[i][j]);
compress(matrix2);
break;
My code is suppose to take in a 5 x 10
matrix of char. But currently my newline is being input into the matrix, how do I actually check for the newline char, and prevent it from going into matrix2[i][j]
?
It reads a total of 4 newline char. Input:
aaabbbcccd (press enter)
ababababab (press enter)
bcdbcdbcdb (press enter)
ababababab (press enter)
abbbcccdda