自己编的一个vc++程序,运行时出现acess violation异常

来源:百度知道 编辑:UC知道 时间:2024/05/14 02:30:44
由于问题字数过多,问题见下面回答。

源程序:gets.c
/***
*gets.c - read a line from stdin
*
* Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
*
*Purpose:
* defines gets() and getws() - read a line from stdin into buffer
*
*******************************************************************************/

#include <cruntime.h>
#include <stdio.h>
#include <dbgint.h>
#include <file2.h>
#include <mtdll.h>
#include <tchar.h>

/***
*char *gets(string) - read a line from stdin
*
*Purpose:
* Gets a string from stdin terminated by '\n' or EOF; don't include '\n';
* append '\0'.
*
*Entry:
* char *string - place to store read string, assumes enough room.
*
*Exit:
* returns string, filled in with the line of input
* null string if \n found immediate