Got something to write about? Check out our Article Builder.

View ezasm\pattern.cpp

Ezasm for linux 1.0

Submitted By: acvivek
Rating: starstarstarstarstar (Rate It)


#include <stdio.h>
#include <string.h>
char * pat(char a[30],char b[30],char c[30])
{
        int la=strlen(a),lb=strlen(b),lc=strlen(c);
        int i=0,j=0,k=0;
        while(i<la && j<lb)
        {
                if(a[i]==b[j])
                {
                        i++;
                        j++;
                }
                else i++;
        }
        if(j!=lb) return a;
        i=i-j;
        while(k<lc)
                a[i++]=c[k++];
        return a;
}
 
corner
© 1996-2008. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin.
bootstrapLabs Logo A bootstrapLabs project.