943,879 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1459
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Jan 29th, 2009
0

Re: Reading Strings From a File

Sorry acted should be " after"
Reputation Points: 10
Solved Threads: 0
Newbie Poster
k88joshi is offline Offline
24 posts
since Nov 2007
Jan 29th, 2009
1

Re: Reading Strings From a File

So replace ".World" with ".Earth"
??

Chris
Reputation Points: 325
Solved Threads: 118
Master Poster
Freaky_Chris is offline Offline
702 posts
since Apr 2008
Jan 29th, 2009
1

Re: Reading Strings From a File

do you want to create tool for this? if yes then try using regular expression.
Reputation Points: 165
Solved Threads: 59
Posting Pro in Training
DangerDev is offline Offline
485 posts
since Jan 2008
Jan 29th, 2009
1

Re: Reading Strings From a File

No, that would be dumb -- you would end up breaking anything with the same name that belonged to another class.
Well when thats what he wanted. I guess thats what we should give. Hence it isnt dumb in any way.


If i had to classes hello and world with member apple.

i would search for hello.apple but not only for apple.
Reputation Points: 673
Solved Threads: 125
Practically a Posting Shark
Sky Diploma is offline Offline
818 posts
since Mar 2008
Jan 29th, 2009
0

Re: Reading Strings From a File

Yes , that's the main thing there are so many classes that it is impossible to save them in an array but some variable names through these classes are same these variable names could be stored in an array. However, this is why it is necssecary to only look for the word "World" rather than the whole word "Hello.Wordl" and replace it with "Earth" resulting in "Hello.Earth".
Reputation Points: 10
Solved Threads: 0
Newbie Poster
k88joshi is offline Offline
24 posts
since Nov 2007
Jan 29th, 2009
3

Re: Reading Strings From a File

Quote ...
that's the main thing there are so many classes that it is impossible to save them in an array but some variable names
We're getting somewhere. Is there a particular reason you need to write this in C++? Would a solution that doesn't use C++ suffice?
Team Colleague
Reputation Points: 1135
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Jan 29th, 2009
0

Re: Reading Strings From a File

Yes totally ...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
k88joshi is offline Offline
24 posts
since Nov 2007
Jan 29th, 2009
2

Re: Reading Strings From a File

So just run something like
C++ Syntax (Toggle Plain Text)
  1. perl -pi -e 's/foo/bar/g' *.cpp *.h
in every directory. Or maybe something like
C++ Syntax (Toggle Plain Text)
  1. find . -name "*.cpp" | xargs perl -pi -e 's/foo/bar/g'
assuming you're running in a unix-like environment. I'm sure you could do something similar in Windows. (Note that 'find' is different on Windows.)

For tasks like this, C++ is not the ideal language.
Team Colleague
Reputation Points: 1135
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005
Feb 2nd, 2009
0

Re: Reading Strings From a File

I do not understand what you mean by the above post .. could you please explain?

This help would be Great....!!!
Kamal Joshi
Reputation Points: 10
Solved Threads: 0
Newbie Poster
k88joshi is offline Offline
24 posts
since Nov 2007
Feb 2nd, 2009
2

Re: Reading Strings From a File

I am talking about using commands like perl, xargs, and find, from the command line. You might need to install software if you want to use these on Windows.
Team Colleague
Reputation Points: 1135
Solved Threads: 171
Super Senior Demiposter
Rashakil Fol is offline Offline
2,478 posts
since Jun 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Execute 2 for loops at the Very same time
Next Thread in C++ Forum Timeline: Need help with ascending numbers program.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC