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 8413753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:58:59+00:00 2026-06-10T00:58:59+00:00

My program looks like that /* print_it.c—This program prints a listing with line numbers!

  • 0

My program looks like that

/* print_it.c—This program prints a listing with line numbers! */
#include <stdlib.h>
#include <stdio.h>

void do_heading(char *filename);

int line = 0, page = 0;

int main( int argv, char *argc[] )
 {
 char buffer[256];
 FILE *fp;

 if( argv < 2 )
 {
 fprintf(stderr, “\nProper Usage is: “ );
 fprintf(stderr, “\n\nprint_it filename.ext\n” );
 return(1);
 }

 if (( fp = fopen( argc[1], “r” )) == NULL )
 {
 fprintf( stderr, “Error opening file, %s!”, argc[1]);
 return(1);
 }

 page = 0;
 line = 1;
 do_heading( argc[1]);

 while( fgets( buffer, 256, fp ) != NULL )
 {
 if( line % 55 == 0 )
 do_heading( argc[1] );

Type & Run 1
nting Your Listings 27
 fprintf( stdprn, “%4d:\t%s”, line++, buffer );
 }

 fprintf( stdprn, “\f” );
 fclose(fp);
 return 0;
 }

 void do_heading( char *filename )
 {
 page++;

 if ( page > 1)
 fprintf( stdprn, “\f” );

 fprintf( stdprn, “Page: %d, %s\n\n”, page, filename );
 }

Using Win 8 + VS 2012. To compile this, opened Developer Command Prompt, and typed

cl print_it.c

Got this screen (bunch of errors and warnings)

enter image description here

What am I missing?

  • 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-06-10T00:59:00+00:00Added an answer on June 10, 2026 at 12:59 am

    It looks like you carelessly copy-pasted. Start by replacing every “ and ” with ".

    Then remove this:

    Type & Run 1
    nting Your Listings 27
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program that looks like this. I need to consistently write something
I have a program that looks something like this: public partial class It {
I wrote a program called Hello.py that looks like this: import pygame, sys from
I have a program that looks like the following: double[4][4] startMatrix; double[4][4] inverseMatrix; initialize(startMatrix)
My program looks like this: -(id)init { if ( (self = [super init]) )
I created a setuid program in C. The executable looks like this: -r-s-r-s--- 1
Consider this program: #include <stdio.h> int main() { printf(%s\n, __FILE__); return 0; } Depending
So I have a a text file that looks something like this: public >ret
I have a Python program for Linux almost looks like this one : import
I wrote a simple python program that looks to me like it should be

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.