Monday, December 8, 2008

String advantage

I started my career in c and not in c++.I was not ever aware of c++ advantages some time back.I was trying things only in C and was sticking onto c in all my implementations.Then came a situation where in I need to learn C++ for a new assignment.
When I started using c++ fulfeldged I felt that the ++ in C really had a meaning."String in C++".This has really helped me a lot.People who have fought with chars in c would really feel cool if they start using strings in c++.Here I am going to tell some of the c++ string manipulations which helped me a lot to save time and energy.No big deal!!!!

First lemme start with finding a particular character in a string array...How do we do it in c.The traditional if condition in a for loop ...yeck... Use find() to get the position in c++.Remember all the functions used with strings are member functions which means you need a string object to call them.