Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 636519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:31:27+00:00 2026-05-13T20:31:27+00:00

I am using VC++ 2008 express edition for C. When I try to run

  • 0

I am using VC++ 2008 express edition for C. When I try to run this:

/* 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");
}

I get four of these errors: error C2065: ‘stdprn’ : undeclared identifier.

On this forum, they wrote that it works to define the printer as follows:

FILE *printer;
printer = fopen("PRN", "w");

EDIT
It builds with a warning that fopen is unsafe. When it runs the error appears:

Debug Assertion fails.
File: f:\dd\vctools\crt_bld\self_x86\crt\src\fprintf.c
Line: 55

Expression: (str != NULL)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:31:28+00:00Added an answer on May 13, 2026 at 8:31 pm

    The stdprn stream was an extension provided by Borland compilers – as far as I know, MS have never supported it. Regarding the use of fopen to open the printer device, I don’t think this will work with any recent versions of Windows, but a couple of things to try:

    • use PRN: as the name instead of PRN (note the colon)
    • try opening the specific device using (for example) LPT1: (once again, note the colon). This will of course not work if you don’t have a printer attached.
    • don’t depend on a printer dialog coming up – you are not really using the WIndows printing system when you take this approach (and so it probably won’t solve your problem, but is worth a try).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 326k
  • Answers 326k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The best format is Apple's Plist format. The iPhone OS… May 14, 2026 at 1:48 am
  • Editorial Team
    Editorial Team added an answer Cmd+I on your project, find the setting containing the string… May 14, 2026 at 1:48 am
  • Editorial Team
    Editorial Team added an answer You have to put on this code in ur application,… May 14, 2026 at 1:48 am

Related Questions

I am having trouble getting my project to link to the Boost (version 1.37.0)
my first question here: I am having trouble using libcURL in a c++ project.
I am working on the Sphere Online Judge problems (OK I am only on
Imagine I am doing something like this: void *p = malloc (1000); *((char*)p) =
I am developing a multi-threading application, which is deadlocking. I am using Visual C++

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.