C++, Get text from a website, part 3
<p>So, thanks for all the help guys, I am just have one last problem, I am putting the website source in a char var, and then reading the product title (I have gotten that), however it only works if I take part of the source, or only the html from one of the featured products on neweggs page. I think the program is crashing, because it doesnt know which title to pick when I need to get all three titles and put them into an array. Any ideas? Thanks. Here is the parser code:</p>

<p><a href="http://paste2.org/p/809045" rel="nofollow">http://paste2.org/p/809045</a></p>

<p>Any solution is greatly appreciated.</p>

<pre><code>/**
 * num_to_next -
 * takes in a pointer to a string and then counts how many 
 * characters are until the next occurance of the specified character
 * @ptr: the pointer to a string in which to search
 * @c: char delimiter to search until
 **/


int num_to_next(char *ptr, char c)
{
        unsigned int i = 0;
        for (i = 0; i &lt; strlen(ptr); i++) {
                if (ptr[i] == c) {
                        return i;
                }
        }
        return -1;
}


/**
 * space_to_underscore -
 * this should help to alleviate some problems when dealing with 
 * filepaths that have spaces in them (basically just changes all 
 * spaces in a string to underscores)
 * @string: the string to convert, yo
 **/


int space_to_underscore(char *string)
{
        for (unsigned int i = 0; i &lt; strlen(string); i++) {
                if (string[i] == ' ') {
                        string[i] = '_';
                }
        }
        return 0;
}

char *file_name = (char *)malloc(sizeof(char *)); // allocate memory for where the app name will be stored
memset(file_name, 0, sizeof(file_name)); // zero the memory

char td_one[] = "&lt;ul class="featureCells"&gt;&lt;li id="ItemCell" class="cell"&gt;";

char *pstr = strstr(buffer, td_one) + strlen(td_one) + 6; // buffer is the source

char *poop = pstr + num_to_next(pstr, '&gt;') + 1;

int blah = num_to_next(poop, '&lt;');

strncpy(file_name, poop, blah);

// null terminate the string //
file_name[blah] = '\0';

space_to_underscore(file_name);

MessageBox(NULL, file_name, "Product Name", MB_OK);

free(file_name);
</code></pre>
