Files using c++

This is a discussion on Files using c++ within the C++ Programming forums, part of the General Programming Boards category; Write a program to read and write a data file. While writing data follow the following instructions: a)Add one space ...

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    2

    Files using c++

    Write a program to read and write a data file. While writing data follow the following instructions:
    a)Add one space between two successive words.
    b)Capitalize the first character of sentences.
    c)If numerical data is present put them in bracket.


    please help.... i am only able to write and read the data..... but not able to perform the given instructions.......

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,401
    So, what is your code for reading and writing the data?
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Nov 2010
    Posts
    2
    cout<<"\n Enter the string.... Press '.' to exit entering:\n";
    getline(cin,s,'.');
    ofstream outfile("tony1.txt");
    for(i=0;i<s.size();j++)
    outfile.put(s[i]);
    cout<<"\n File Written.....\n";
    ifstream infile("tony1.txt");
    cout<<"\n Reading from file....\n";
    cout<<infile.rdbuf();
    cout<<endl;
    cout<<"\n Reading file complete.....\n";

    i hav used the following code.....
    Last edited by Himanka; 11-01-2010 at 11:35 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 08-11-2009, 06:45 AM
  2. Header files and multiple definitions
    By sjweinberg in forum C++ Programming
    Replies: 16
    Last Post: 07-17-2009, 05:59 PM
  3. *.cpp and *.h files understanding
    By ElastoManiac in forum C++ Programming
    Replies: 4
    Last Post: 06-11-2006, 04:45 AM
  4. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 10:46 AM
  5. Multiple Cpp Files
    By w4ck0z in forum C++ Programming
    Replies: 5
    Last Post: 11-14-2005, 01:41 PM

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