SimStil
SimStil

Reputation: 59

What is required to be able to use Debug.Assert() function?

When I try to use Debug.Assert() within my C++ code in Visual Studio 2019 it is not recognising this class and states "identifier "Debug" is unidentified".

I am new to C++ and I discovered this function in a Microsoft Visual Studio article on debugging tools, however, it only shows its implementation but does not mention having to include any libraries to do so. I have searched a lot for why this might not work and have gotten nowhere with it.

Upvotes: 0

Views: 152

Answers (1)

Hatted Rooster
Hatted Rooster

Reputation: 36483

Debug.Assert() is a method in C# which is a completely different language than C++ even though Visual Studio supports both.

C++ has assert in <cassert> (borrowed from C).

Upvotes: 2

Related Questions