Jump to content

Print Image Format form withing a C program???


Recommended Posts

Hey,

 

I am doing a project for school and part of the requirements are to print some reports generated by a C program to something called 'print image format'.

 

Does anyone know what this is and how to go about programming it?

 

Link are always welcomed.

 

Thanks

Link to comment
Share on other sites

I have no idea, and my C knowdlege is very limited, but as Linux is written in C you have almost all the section 3 of the man pages dedicated to C.

 

You might take a look to that with an apropos image | egrep "format.*3|3.*format" or similar

 

Is just a hint, I don't like to see unanswered posts :roll: :)

Link to comment
Share on other sites

Hey,

 

I am doing a project for school and part of the requirements are to print some reports generated by a C program to something called 'print image format'.

 

Does anyone know what this is and how to go about programming it?

 

Link are always welcomed.

 

Thanks

 

I would ask for some clarification, a search for "print image format" in google turns up nothing relevant so many be they are just talking about postscript or something?

Link to comment
Share on other sites

Got this from MSDN

 

Print formatted data to a stream.

 

fprintf formats and prints a series of characters and values to the output stream. Each function argument (if any) is converted and output according to the corresponding format specification in format. For fprintf, the format argument has the same syntax and use that it has in printf.

 

fwprintf is a wide-character version of fprintf; in fwprintf, format is a wide-character string. These functions behave identically otherwise.

 

Security Note Ensure that format is not a user-defined string.

 

// crt_fprintf.c

/* This program uses fprintf to format various

* data and print it to the file named FPRINTF.OUT. It

* then displays FPRINTF.OUT on the screen using the system

* function to invoke the operating-system TYPE command.

*/



#include <stdio.h>

#include <process.h>



FILE *stream;



int main( void )

{

  int    i = 10;

  double fp = 1.5;

  char   s[] = "this is a string";

  char   c = 'n';



  stream = fopen( "fprintf.out", "w" );

  fprintf( stream, "%s%c", s, c );

  fprintf( stream, "%dn", i );

  fprintf( stream, "%fn", fp );

  fclose( stream );

  system( "type fprintf.out" );

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...