Project Euler #4 - Finding the largest palindrome that is the product of two three-digit numbers.
using namespace std; is a bad practice.  You should should spell out either what you are using, or spell out explicitly the std:: when you are using something.  You are doing the latter already with std::to_string and std::cout, just not with string.

Your palindromeCheck function should return a bool, instead of an int with specific integers having certain meanings.

temp is not used.

You are checking both 100 * 101 and 101 * 100.   Multiplication is commutative, so you can cut your work in half by adjusting your inner y loop to only use number from a range which hasn't been checked yet (from x to 999, inclusive).

newDigit is an odd variable name for the product of x * y.

palindromeCheck(newDigit) is an expensive operation.  newDigit &gt; highestPalindrome is a relatively cheap test.  Consider reversing the order of these tests to avoid calling an expensive function when the result will never be used.