Write the definition of a function grace_score (int score[], int size) in C++, which should check all the elements of the array and give an increase of 5 to those scores which are less than 40.
Example: if an array of seven integers is as follows:
45, 35, 85, 80, 33, 27, 90
After executing the function, the array content should be changed as follows:
45, 40, 85, 80, 38, 32, 90