我使用C. VC++ 2008年速成版当我尝试运行此:如何使打印机在MS VC++ Express版C中工作?
/* Demonstrates printer output. */
#include <stdio.h>
main()
{
float f = 2.0134;
fprintf(stdprn, "This message is printed.\n\n");
fprintf(stdprn, "And now some numbers:\n\n");
fprintf(stdprn, "The square of %f is %f.", f, f*f);
/* Send a form feed */
fprintf(stdprn, "\f");
}
我得到这些错误四:错误C2065:STDPRN“:未声明的标识符。
在this论坛上,他们写道,它的作品来定义打印机如下:
FILE *printer;
printer = fopen("PRN", "w");
编辑 它建立与的fopen是不安全的警告。当它运行时出现错误:
调试断言失败。 文件:F:\ DD \ vctools \ crt_bld \ self_x86 \ CRT \ SRC \ fprintf.c 行:55
表达式:(!STR = NULL)