By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,204 Members | 1,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,204 IT Pros & Developers. It's quick & easy.

Search & Replace a uchar* to a char array

P: 1
I have a similar problem as posted in the following thread:

The difference is that I need to search for words not just a single character and then replace the word if it is found.

I am relatively new to the C programming thing as well (done a lot of PHP and Java), so my understanding of pointers, etc is still novice.

Any help would be greatly appreciated.
Sep 14 '10 #1
Share this Question
Share on Google+
2 Replies

Expert 100+
P: 983

I will assume that the search and replace strings are of arbitrary length, meaning you've got a modest problem.

Assuming you've got access to C++, the std::string class has a good series of replace(...) methods you can use.

With just C - there are some very good C libraries around the net that you can google.

There's also a lot of junk.

Failing either of those, just take your time, write an algorithm, and we'll help you from there.
Sep 14 '10 #2

P: 542
Maybe the strstr()function in the header file <cstring> and the replace()function defined in the header file <algorithm> could be a starting point,
Sep 15 '10 #3

Post your reply

Sign in to post your reply or Sign up for a free account.