writing a number to a text file

This is a discussion on writing a number to a text file within the C Programming forums, part of the General Programming Boards category; Yes, I know it's very simple, but my mind is not working at this moment. I have a floating point ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    6

    writing a number to a text file

    Yes, I know it's very simple, but my mind is not working at this moment.

    I have a floating point variable called 'final'. I want to write it into a text file, but as far as I know the functions like fputs() or fwrite() all take pointers not the variables. Is there any other function I can use to store my variable to a text file?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    You can use either of those, if you use them correctly. You can also use something like fprintf.


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

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    6
    Thanks.
    fprintf() works

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. gcc link external library
    By spank in forum C Programming
    Replies: 6
    Last Post: 08-08-2007, 03:44 PM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Counting Number of Words in a Text File Using C
    By wvu2005 in forum C Programming
    Replies: 16
    Last Post: 09-27-2005, 11:45 AM
  4. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21