I'm trying to compare the value of C against strlen(sn) and update C to the new length if it is smaller. I keep getting an invalid conversion from char* to unsigned int. I understand the error message, I just need help trying to fix it. I have the following line of code:
1 2 3 4 5 6 7 8 9 10 11
max = 50;
unsignedint C;
char* sn[max];
if (C < strlen(sn))
{
size_t size = strlent(sn);
C = newchar[1 + size];
strcpy (C, size)
}
Hint: sn is not a string, it is also not initialized in the code snippet you supplied. And max should be a compile time constant, not just any variable.