You are still not using a function. You use a return statement, you have no function except main to return from. Your book or lecture notes must have an example for a function. Read it. Understand it. Then look again at Post #3 above.
You are still having a condition while (target != SENTINEL) but don't change either value in the loop. The condition can thus be only "always true" or "always false" thus making little sense.

