Explain assert function.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter13: Overloading And Templates
Section: Chapter Questions
Problem 5SA
icon
Related questions
Question

Explain assert function.

Expert Solution
Step 1

Assert function

  • Assertions are statements used to test assumptions made by programmer.
  • It will terminate the program with a message quoting the assert statement.
  • It is used while its argument turns out to be false.
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer