Thread: WARNING "fprintf ()" C function

  1. #1
    Unregistered
    Guest

    WARNING "fprintf ()" C function

    /*ModEdit: If you are reading this the first time, don't sweat it, the following is complete nonsense. -nv, mod*/

    I am now warning you of an inportant C function which can cause collosal damage to your machine. We have tested the fprintf () function persistantly and through this testing the function has cause 3 of our mchine hard discs to CRASH.

    WARNING: Do Not Use the fprintf or fscanf functions unless you absolutely have to. It is better to used getc() and putc() instead. The risk is too great!!!!

    Dr. A. Prioski
    CEng. CPhys. CMath. MSc, PHD, DSc (Oxford). MIEE. MIEEE.

  2. #2
    The Artful Lurker Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    Hi Doc,

    We're all big boys and girls here. Perhaps you could explain why fprintf() and fscanf() are potential hazards.

    Thanks.
    Jason Deckard

  3. #3
    Unregistered
    Guest
    The unstable nature of these functions can cause mal operations in the disc head. This can mean that the nagative feeback to the head(s) is never activated and the read/write mechanism crashes into the side of the disc casing.

    As I say it is better not to use these functions!

  4. #4
    The Artful Lurker Deckard's Avatar
    Join Date
    Jan 2002
    Posts
    633
    That's hardly an explination, let alone believable. Post your code examples, please.
    Jason Deckard

  5. #5
    Registered User dharh's Avatar
    Join Date
    Jan 2002
    Posts
    51
    What exactly did you do?

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    Well darn, I suppose that a lot of hard drives have been crashing without anyone knowing.

    >WARNING: Do Not Use the fprintf or fscanf functions unless you absolutely have to.
    Okay, give us a real explanation as to why not. Keep in mind that we're real programmers, not students who will happily use stuff like void main and fflush ( stdin ) just because you say so. Give us proof, source code to test your theory, etc...

    -Prelude
    My best code is written with the delete key.

  7. #7
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Dr A Prioski?????? That's gotta be an anagram (RIP is a dork??)
    Visit entropysink.com - It's what your PC is made for!

  8. #8
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    OH NO!!!1 THE FPRINTF BROKEN MY COMPUTAR MACHEINE!!!!!!!!!111

  9. #9
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    I don't buy it.

  10. #10
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    No it is true.

    I AM DOCTAR COMPUTAR

    TEH FPRINTF IS PROVEN BIOLOGICALL YOT BRAEK COMPUTARS WIHT TEH WINODWS AND MAEK UR HRAD DRIEV CRASHE LIEK A POO!!11

    I HAEV A PHD IN COMPUTAROLOGY

  11. #11
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Well, goshdarn it, I just typed FPRINTF into notepad, and my drive heads broke through the side of my drive and embedded themselves in the wall
    Visit entropysink.com - It's what your PC is made for!

  12. #12
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Me too me too!

    Oh, let's assume that 'fprintf' is no longer a viable solution.
    We still have:

    fwrite, fputs, fputc, write...

    However, just to throw my two cents in: If 'fwrite' were so flawed, wouldn't ANSI have caught it? Wouldn't Microsoft have caught it? Wouldn't the makers of GCC have caught it? Wouldn't Borland have caught it? Wouldn't....

    No, some "great doctor" comes out of the blue and surprises the world. Now sure, I suppose it took some nut job to discover that the world was not flat, but we're a bit beyond that point.

    Furthermore, there are MILLIONS of programs written in C which make use of fprintf. Surely it would have been discovered by now.

    Quzah.
    Hope is the first step on the road to disappointment.

  13. #13
    www.entropysink.com
    Join Date
    Feb 2002
    Posts
    603
    Errrrr Reality check please!
    Visit entropysink.com - It's what your PC is made for!

  14. #14
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    Thanks for the info. I'll stop using them immediately. I've long suspected something like this, and your post has confirmed my own findings.

  15. #15
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    I bet that the Doc is some lame kid that been messing up pointers and erased some important stuff on his harddrive. He don't know what he did and refuse to see that he could do something wrong so he blame fprintf. He and his bright buddies try to run the same code on another computer and it do the same thing wich ofcourse prove there point.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  2. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Errors
    By Rhidian in forum C Programming
    Replies: 10
    Last Post: 04-04-2005, 12:22 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM