ComputerForum.com ComputerForum.com  
Go Back   Computer Forum > General Chat > General Computer Chat

Reply
 
LinkBack Thread Tools Display Modes
Old 09-19-2006, 08:31 AM   #1 (permalink)
Moderator
 
Shady's Avatar
 
Join Date: Mar 2006
Location: Cairo
Age: 21
Posts: 2,362
Default someone help me with this C++ code !

Code:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;

int main()
{
	string c,d = "";
	fstream reads("R0_1st.txt",ios::in);
	fstream writes("new.txt",ios::in|ios::out);
	reads.unsetf(ios::skipws);
	
	while ( getline ( reads, c ) ) {
		cout<<c<<endl;
		if ( c.find ( "Adiabatic Efficiency" ) != string::npos )
			
		{	
			cout<<">>>>>>>>>>>>>>>"<<endl; //Just to make sure it got here
			while( getline (writes,d) )
			{
				if ( d.find ("replace here") != string::npos )
				{
					cout<<"<<<<<<<<<<<<<<<"<<endl; //Just to make sure it got here
					writes<<c;
				}
			}
		}
	}

	return 0;
}
the problem is nothing happens to "new.txt"
__________________
Phenom X4 9850 BE
Gigabyte GA-MA790X-DS4
2GB Kingston DDR2 800
Radeon HD 3450
WD5000AAKS 500 GB
Shady is offline   Reply With Quote


Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need table code New_compforum_user General Software 2 05-11-2006 07:42 PM
How do I add PHP code into my HTML web template? Liam Internet Discussion 4 02-16-2006 09:04 PM
does anyone have a windows 95 key code madyalper Operating Systems 6 02-05-2006 03:57 PM
network cmd code too... lerner Internet Discussion 6 09-22-2005 07:44 PM
Code 19 error on both disk drives lonergamefreak CD/DVD Technology 1 05-04-2005 01:23 PM

All times are GMT +1. The time now is 12:18 PM.


Powered by: vBulletin Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2002-2008 Computer Forum and Web Design Forum