using 'strcpy_s' error c2660

void sortData(int size, char studentName[][6])
{
    bool swap;
    int temp[6];

    do {
        swap = false;
        for (int count = 0; count < (size - 1); count++) {
            if (strcmp(studentName[count], studentName[count + 1]) > 0) {
                strcpy_s(temp, studentName[count]);
                strcpy_s(studentName[count], studentName[count + 1]);
                strcpy_s(studentName[count + 1], temp);
                swap = true;
            } // end if
        } // end for
    } while (swap);

}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.