Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

[SOLVED] Working With Data Files In C

form

  • This topic is locked This topic is locked
16 replies to this topic

#13 Agent001

Agent001

    CC Regular

  • Member
  • PipPipPip
  • 41 posts

Posted 28 May 2012 - 10:23 AM

12.511254f

What does this f at the end mean?
Can i put a variable instead an exact number? If i put a variable name seem's it wont work?
  • 0

#14 kernelcoder

kernelcoder

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 990 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal

Posted 28 May 2012 - 10:26 AM

The f at the end means a number of type float. If you omit the f, it will a value of type double. Yes, you can put a variable of type float there instead literal value.
  • 0

#15 Agent001

Agent001

    CC Regular

  • Member
  • PipPipPip
  • 41 posts

Posted 28 May 2012 - 11:17 AM

Ok, that's solved.

One more question, how do i change the format of the output file, to be .sub instead of .txt?
  • 0

#16 kernelcoder

kernelcoder

    CC Devotee

  • Expert Member
  • PipPipPipPipPipPip
  • 990 posts
  • Location:Dhaka
  • Programming Language:C, Java, C++, C#, Visual Basic .NET
  • Learning:Objective-C, PHP, Python, Delphi/Object Pascal

Posted 28 May 2012 - 08:27 PM

You can just change the extension to you file. As example, FILE *out = fopen("output.sub", "w+") ;.
  • 0

#17 Roger

Roger

    Skadoosh!

  • Administrator
  • 1222 posts
  • Programming Language:C, PHP
  • Learning:Others

Posted 29 May 2012 - 09:05 AM

This topic has been marked as SOLVED. If you have a similar question or topic, go back to the subforum and start a new topic to continue discussions.
  • 0

New around here? Click here to register and start participating in under a minute?

Or do a quick search and you may find the answer you're looking for.






Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download