Dev-C下无法阻止assert让窗口闪灭了!
#include<iostream>#include<assert.h>#include<windows.h>#include<stdlib.h>#include<stdio.h>using namespace std;int test(int a,int b){ cout<<"acd"<<endl; if(a+b>6) { assert(!"Should never get here!"); system("pause"); return -1; } return a+b; }int main(){ int m=test(6,1); cout<<"m = "<<m; //test(1,2); getchar(); system("pause"); return 0;}