Invalid Conversion from char* to unsigned int

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;
unsigned int C;
char* sn[max];

if (C < strlen(sn))
{
size_t size = strlent(sn);
C = new char[1 + size];
strcpy (C, size)
}
Last edited on
it has to be a joke
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.


Topic archived. No new replies allowed.