RE: fagcommunity.rocks 11-30-2014, 08:24 PM
#97
(11-30-2014, 08:17 PM)dopamine Wrote: I wont do it but..
Here you go, startswith(), endswith() in C++:
Code:bool StartsWith(char* pszBuffer, char* pszData) { int iDataLen = strlen(pszData); char* pszCheckData = (char*)malloc(iDataLen); memcpy(pszCheckData, pszBuffer, iDataLen); return lstrcmpA(pszCheckData, pszData) == 0; } bool EndsWith(char* pszBuffer, char* pszData) { int iBufferLen = strlen(pszBuffer); int iDataLen = strlen(pszData); char* pszCheckData = (char*)malloc(iDataLen); memcpy(pszCheckData, pszBuffer + (iBufferLen - iDataLen), iDataLen); return lstrcmpA(pszCheckData, pszData) == 0; }
Wrote it in this editor, took 2 minutes. Maybe now u believe I can code? lol
Who knows ?
Google would even give you such solutions. like search by startswith in C# or C etc. etc.
Also those startswith are beginner stuffs, you have 7+ years of experience, you should start your own lessons you know. I am pretty sure that I after 3-4 years I will be a fucking awesome programmer who knows a good deal of math for programming problems unlike you (7+)

WHat happend ? Scared of challenge ?
Okay have an easier one then (pretty easy) :- https://www.sinister.ly/Thread-Contest-A...Evaluation
I have even given the algorithm there (a basic one but works)
![[Image: OilyCostlyEwe.gif]](http://fat.gfycat.com/OilyCostlyEwe.gif)
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)