return value doesnt match the function

Dec 23, 2017 at 2:23am
I am getting an error saying return value does not match the function type at the return sku part. Anyone knows why?
1
2
3
const char* NonPerishable::sku() const {
		return sku;
	}


and my sku is

char sku[31]
Dec 23, 2017 at 2:31am
I don't think you can return arrays.
Last edited on Dec 23, 2017 at 2:31am
Dec 23, 2017 at 3:20am
The name of the function sku in the inner scope hides the name of the array sku in the outer scope.
Topic archived. No new replies allowed.