For the sake of learning C++ I'm trying to convert DelimitedStringFunctions.lua file to C++. But I don't know how to accept any type of array (eg it doesn't matter what kind of items it has). Should I use a structure instead? I'm not too familiar with C++, but here's my current code anyway:
Code:#include <string> // This function will make an array into a delimited string long funcConcatArray(long longArray, char charDelimiter) { // Define the string we'll return std::string strReturn; // Get the size of the array unsigned long longArraySize = sizeof(longArray); // For each item in the array for (unsigned long longIndex = 1; longIndex => longArraySize; intN++) { // If we have reached the end of the array if (longIndex > longArraySize) { // Add the last item to the string strReturn += longArray[longIndex]; // If we haven't reached the end of the string } else { // Add the item and the delimiter to the string strReturn += longArray[longIndex] + charDelimiter; } } // Return the delimited string return strReturn; }

