C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 06-22-2009, 02:58 AM   #1
Registered User
 
Join Date: Jun 2009
Posts: 4
Hello,i need assistance in completing the code

Hello,i need assistance in completing the code, I do not have enough experience, anyone can complete it?
it is at one point change 1 word in new and need to able to change more than words .. Thank you very much for the former.

Code:
#include <iostream>
#include <fstream>
#include <string>
#include <iterator>
#include <algorithm>
using namespace std;
int main()
{
    string line;
    ifstream finp("./src/example.txt");
    ofstream fout("./src/example2.txt");
    if (!finp || !fout)
    {
        std::cout << "Error opening file\n";
        return 1;
    }

    copy(istream_iterator<char>(finp >> noskipws), istream_iterator<char>(), ostream_iterator<char>(cout));
    finp.clear();
    finp.seekg(0);
    finp.setf(ios_base::skipws);
    std::string word;
    std::string m,n;
    cout << endl;
    cout << endl;
    cout << "Ce cuvint doritzi sa modificatzi? : ";
    getline(std::cin, m);
    cout << "Cu ce cuvint doritzi sal modificatzi? : ";
    getline(std::cin, n);
        bool found = false;
        while (!finp.eof() && !(finp >> word).fail())
        {
        	     if (word == m)
            {
                fout << n << " ";
                found = true;
            } else
                fout << word << " ";
        }
        if (!found)
            cout << "Asha cuvint nu exista in propozitzia data!!!!!!\n";
    }
toader is offline   Reply With Quote
Old 06-22-2009, 03:32 AM   #2
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,295
How about no?

You didn't even listen to what people told you in your other thread, помогите закончить код
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Assistance Nezmin2 C Programming 12 12-19-2008 12:26 AM
Values changing without reason? subtled C Programming 2 04-19-2007 10:20 AM
Obfuscated Code Contest Stack Overflow Contests Board 51 01-21-2005 04:17 PM
Interface Question smog890 C Programming 11 06-03-2002 05:06 PM
C code assistance please lotus C Programming 7 05-25-2002 02:29 AM


All times are GMT -6. The time now is 12:46 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

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