#include #include using namespace std; // Outputs the contents of Packet with Text prefix void DisplayContents(clPacket & Packet, char * Text) { // Move cursor to start of packet Packet.SetCursor(0); // Return string containing contents of packet char * Contents = Packet.GetStringC(Packet.GetUsedSize(),true); // Write packet contents to screen cout << Text << '\n'; cout << Contents << "\n\n"; // Deallocate memory delete[] Contents; } void main() { // Create packet containing "Hello World" clPacket Packet("Hello World"); DisplayContents(Packet, "Packet before inserting 'Big':"); // Create empty space after hello Packet.SetCursor(5); Packet.Insert(4); Packet.AddStringC(" Big", 0, false); DisplayContents(Packet, "Packet after inserting 'Big':"); // Erase the word big Packet.Erase(6, 4); DisplayContents(Packet, "Packet after erasing 'Big':"); // Exit system("PAUSE"); return; }