I put together this program for a lab in class. The task is to generate a array of random characters of a size determined by the user. After that we have to write a function that takes in that array and prints out the highest consecutive occurence of a character within that array.
for example if the array is aaaabbcc
the result is aaaa.
I was able to get pretty far until I moved my code around. All I did was copy and past some code in the program to put it into a function called OccChar. Now I get a error telling me "expected primary expression before ']' token on LINE 33
P.S. This is for school. Looking to major in COMPUTER SCIENCE.
When you pass an array to a function, you do not include the brackets. The error message is telling you exactly what the issue is- you put in brackets on line 33 next to the array pointer when you did not need to.