---
# System prepended metadata

title: Untitled

---

#include <stdio.h>


int FindString(char ** strings, int num_strings, char * string)
{
    int num_found = 0;
    for(int i = 0; i < num_strings; i++)
    {
        char * p0 = strings[i];
        char * p1 = string; 
        while(*p0 != '\0')
        {
            while(*p0 != *p1 && *p0 != '\0') p0++;
            while(*p0 == *p1 && *p0 != '\0') { p0++; p1++; }
            if(*p1 == '\0') num_found += 1; 
            p1 = string; 
        }
    }
    return num_found; 
}

int main(int argc, char **argv)
{
    char * strings[] = {
        "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor",
        "incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud",
        "exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute ",
        "irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla",
        "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia",
        "deserunt mollit anim id est laborum."
    };
    
    char * string = "la";
    int num_strings = sizeof(strings) / sizeof(char *);
    int num_found = FindString(strings, num_strings, string);
    printf("Den innehåller: %i sonna.\n", num_found);
    
	return 0;
}
