What is the best way to loop through an array in order to look for a sepcific character. If that character isn't found, I need to insert it into the string at a particular spot (between the 3rd and 4th character)
Any ideas?
Thanks
What is the best way to loop through an array in order to look for a sepcific character. If that character isn't found, I need to insert it into the string at a particular spot (between the 3rd and 4th character)
Any ideas?
Thanks
Check the man page (or other documentation) on the standard library function strchr().
In addition to strchr(), look at memmove().
If you understand what you're doing, you're not learning anything.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.