I need a shitty function to tell me if a string contains another - i.e. it should return true for "you are a faggot" and "asdfaggotsds" provided the second string is faggot, in c. I'm obviously too lazy to write it myself since it's a small part of an unnecessarily large homework and my inadequate googling skills prevented me from finding out what it should be - I assume /prog/ can guide me successfully as you are all [b]EXPERT PROGRAMMER[b]s who know all this shit.
Name:
Anonymous2009-03-22 13:00
in after bbcode failure
Name:
Anonymous2009-03-22 13:12
strstr
Name:
Anonymous2009-03-22 13:19
#include string
using namespace std;
int yourAFaggot(string faggot, string otherFag)
{
return faggot.find(otherFag);
}
c has extensive string manipulation abilities. unfortunately they are no wrapped up in a nice class.
unfortunately often people dont know of them until they are an [c]EXPERT C PROGRAMMER[/b].
If you are on a unix-type system, I recommended reading all of these -
ls /usr/share/man/man3/str*
as you may end up saving yourself a lot of work.
Having said that, I have a custom set of str functions i make use of also in my projects - things like a variadic strdup that you can pass a bunch of strings to and it concatenates them to a newly allocated string.. to make c strings a bit more convenient.
>>22 lack of * Ubuntu
I think you got the wrong distribution. Ubuntu is about including absolutely every peice of software and information under the sun in the main releases.