Thread: How to input doubles in to files

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    241

    How to input doubles in to files

    This is my code

    Code:
    	String="("+(std::string)P+"*"+(std::string)L+")"+" ^ "+(std::string)T+" /4= "+(std::string)A+"\n";
    	a_file<<String;
    P,L,T,A are doubles how can I get a_file to write doubles in to a file

    I tried without the (std::string) and I tried just doin

    Code:
    a_file<<"("<<P<<"*"<<L<<")"<<" ^ "<<T<<" /4= "<<A<<"\n";
    I just don't know what to do

    I also tried

    Code:
    	String="("+P+"*"+L+")"+" ^ "+T+" /4= "+A+"\n";
    	a_file<<String;
    Last edited by bikr692002; 08-27-2006 at 01:52 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  2. How to get input from multiple files?
    By jumpyg in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2003, 09:20 PM
  3. h/w help
    By helpme in forum C Programming
    Replies: 20
    Last Post: 10-21-2003, 09:36 AM
  4. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 08:12 PM
  5. string input from files
    By jriano in forum C++ Programming
    Replies: 3
    Last Post: 06-01-2003, 01:08 PM