Hello there,
I want to know if anybody knows about a function to change a string for another one. If not, I suppose i would have to work in it. Thank you very much.
Hello there,
I want to know if anybody knows about a function to change a string for another one. If not, I suppose i would have to work in it. Thank you very much.
Do you mean to replace a substring? Or to alter a current string (ie, strcpy()) ?
Have a look through here to see if you can find a function that does what you want:
http://en.wikipedia.org/wiki/String.h
the problem is for example if a have the string:
(pointer)line->"I have no mouth but ..."
and I want to change the word mouth by "yes" for example. the result should be:
line->"I have no yes but ..."
Thank you for your help.
A little search on this forum for "substring replace" gave me immediately two very interesting threads:
http://cboard.cprogramming.com/showt...string+replace
http://cboard.cprogramming.com/showt...string+replace
Both contain explanations as well as working functions.
Thank you! I will see those articles!
I'm Jesus, I feed entire nations with only one fish.
I thought it was:
Light a fire for a man and he'll be warm for a day.
Light a man on fire and he'll be warm the rest of his life.
If you understand what you're doing, you're not learning anything.