求助高手think in c++ 中程序的问题
#include <stdlib.h>#include <assert.h>
#include "Nest.h"
#include <stdio.h>
#include <string.h>
void main(int argc,char** argv)
{
stack textlines;
FILE* file;
char* s;
#define BUFSIZE 100
char buf[BUFSIZE];
assert(argc==2);
textlines.initialize();
file=fopen(argv[1],"r");
assert(file);
while(fgets(buf,BUFSIZE,file))
{
char* string=(char*)malloc(strlen(buf)+1);
assert(string);
strcpy(string,buf);
textlines.push(string);
}
while((s=(char*)textlines.pop())!=0)
{
printf("%s",s);free(s);
}
textlines.cleanup();
}
运行后出现fatal error ,说 assert(argc==2);有错误