Am I misunderstanding assert() usage?

后端 未结 3 1265
感动是毒
感动是毒 2021-01-03 21:29

I was taking a look at the assert() reference page and I got stuck while I read the given example:

/* assert example */
#include 
#include <         


        
3条回答
  •  误落风尘
    2021-01-03 22:03

    Minor notification: it would be better if you write..

    FILE * datafile = NULL;
    

    Also, assert only works in debug mode... so your method is better.

提交回复
热议问题