How to compare two char* variables

Posted by davit-datuashvili on Stack Overflow See other posts from Stack Overflow or by davit-datuashvili
Published on 2010-05-14T19:15:49Z Indexed on 2010/05/14 19:54 UTC
Read the original article Hit count: 176

Filed under:
|
|

Suppose we have the following method (it is in c code):

const char *bitap_search(const char *text, const char *pattern)

My question is how can I compare text and pattern if they are char? This method is like a substring problem but I am confused a bit can I write in term of char such code? if (text[i]==pattern[i])? look i am interesting at this algorithm in java http://en.wikipedia.org/wiki/Bitap_algorithm how implement this in java?

R = malloc((k+1) * sizeof *R);

and please help me to translate this code in java

© Stack Overflow or respective owner

Related posts about algorithms

Related posts about c