String parser review So the task is that a string being passed to one of my methods looks like this

&lt;DIV&gt;&lt;GKY&gt;&lt;UID&gt;&lt;END&gt;

it is generated this way from another program, so it will always have that format. Now to sum up how it works is like this.. This is to represent 3 byte arrays a DIV key (short for diversification) a Guest Key (GKY), and a Unique ID (UID). This particular class that i made stores those byte arrays as a 2 character hex string. IE {0x03, 0xFE, 0xE0} would be stored as "03FEE0"

so those are the requirements of the class.. I have to be able to parse that string to store those byte arrays for access later. DIV (if present) will always be 16 bytes long. GKY is variable and can be at most 192 bytes. UID is required and will always be present and is always 7 bytes. so I came up with this... as far as I can tell it works.

#pragma once

class KeyInputParser
{
public:
    KeyInputParser(void)
    {
        //DIV will always be 16bytes... but it is either not required
        DIV = new char[32];
        //uid will ALWAYS be 7 bytes and is required
        UID = new char[14];
    }
    ~KeyInputParser(void)
    {
        delete[] DIV;
        delete[] GKY;
        delete[] UID;
    }
    char* DIV;
    char* GKY;
    char* UID;
    void SetKeyString(const char* str)
    {
        wcout &lt;&lt; "KeyInputParser::SetString()+" &lt;&lt; endl;
        wcout &lt;&lt; "\t" &lt;&lt; str &lt;&lt; endl;

        char* div;
        char* gky;
        char* uid;

        div = (char*)memchr(str, '&gt;', strlen(str));
        div++;

        gky = (char*)memchr(div, '&gt;', strlen(div));
        gky++;

        uid = (char*)memchr(gky, '&gt;', strlen(gky));
        uid++;

        for(int i=0; i&lt;strlen(div); i++)
        {
            if(div[i] == '&lt;')
            {//DIV will always be 16bytes... but it is either not required
                memcpy(DIV, div, i);
                DIV[i] = '\0';
                break;
            }
        }
        for(int i=0; i&lt;strlen(gky); i++)
        {//gky will vary, but max out at 192 bytes
            if(gky[i] == '&lt;')
            {
                GKY = new char[i+1];
                memcpy(GKY, gky, i);
                GKY[i] = '\0';
                break;
            }
        }
        for(int i=0; i&lt;strlen(uid); i++)
        {//uid will ALWAYS be 7 bytes and is required
            if(uid[i] == '&lt;')
            {
                memcpy(UID, uid, i);
                UID[i] = '\0';
                break;
            }
        }

        wcout &lt;&lt; "KeyInputParser::SetString()-" &lt;&lt; endl;
    }
};


I don't care for the way it came out, but I am very new to C++.
First of all separate code into header (.hpp) and implementation file (.cpp)

Header : (my_header.hpp)

#ifndef MY_HEADER
#define MY_HEADER
class KeyInputParser
{
public:
    KeyInputParser  () // there is no need for funcName (void) in C++
    ~KeyInputParser () // that is neccessary only for C
    char* DIV;
    char* GKY;
    char* UID;
    void SetKeyString (const char* str);
    // Progress bewteen div, gky and uid
    char* Progress (char* previous);
    // Get data between &lt;&gt;
    void ExtractField (char* small, char* big);
};
#endif


Implementation : (my_code.cpp)

#include &lt;cstring&gt; 
#include "my_header.hpp"

KeyInputParser::KeyInputParser () 
{
    //DIV will always be 16bytes... but it is either not required
    DIV = new char[32];
    //uid will ALWAYS be 7 bytes and is required
    UID = new char[14];
}

KeyInputParser::~KeyInputParser () 
{
    delete[] DIV;
    delete[] GKY;
    delete[] UID;
}

char* KeyInputParser::Progress (char* previous) 
{
    char* arr = (char*) memchr (previous, '&gt;', strlen (previous));
    arr++;
    return arr;
}

void KeyInputParser::ExtractField (char* small, char* big) 
{
    for(int i = 0; i &lt; strlen (small); i++)
    {
        if(small [i] == '&lt;')
        {
            memcpy (big, small, i);
            big[i] = '\0';
            break;
        }
    }
}
void KeyInputParser::SetKeyString (const char* str) 
{
    char* div = Progress (str);
    char* gky = Progress (div);
    char* uid = Progress (gky);

    ExtractField (div, DIV);
    // Code for GKY will be copied due to allocation
    // It might be possible to fix it to be used with ExtractField function
    for(int i = 0; i &lt; strlen (gky); i++)
    {
        if(gky[i] == '&lt;')
        {
            GKY = new char[i+1];
            memcpy(GKY, gky, i);
            GKY[i] = '\0';
            break;
        }
    }
    ExtractField (uid, UID);
}


This is just a rough refactoring of your code.
The thing number one that will need to be fixed is to drop all those C string functions and use std::string instead.

I did not test the code so I cannot guarantee that it will work but this is how it should look like. Hope I helped :)