After testing, I encountered the same result as you, which will cause warning C4101. You only need to initialize local variables to solve this problem, or do not use uninitialized variables.
Regarding why there is no warning for vector<int>, we can see that vector is a class, and class will automatically call the default constructor when defining variables, which will initialize it, so vector<int> will not cause this problem.
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.