Comparing parallel arrays read from a text file

I have a question about using two parallel arrays.

For example, I read in 20 characters from a text file into a character array. Then I read in 20 different characters from another text file with a different character array.

How can I compare the two and see if they match?

This is a separate function from the main, so this function will be passed on the arrays from main.

1 answer

  • answered 2017-12-06 06:04 Suzo

    It was actually extremely easy (in case anyone else was wondering)

    All i did was create a for loop, and inside the loop created an if statement where i called in the corresponding cells of each. If they were not equal i made a counter of how many were wrong, and displayed it at the end.

    And if the questions were right do nothing.

    I don't know if i explained it super well. I'm still super new to programming and i gotta say the feeling of figuring something out on your own after a lot of work feels really good :).

    Thanks for the replys.