cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
user name:
password:
Forgot your password?
please wait
try again
cancel
forgot your password?
sign up
log in
[Legacy version]
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
return value doesnt match the function
return value doesnt match the function
Dec 23, 2017 at 2:23am
Dec 23, 2017 at 2:23am UTC
lithony
(26)
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
Dec 23, 2017 at 2:31am UTC
fiji885
(306)
I don't think you can return arrays.
Last edited on
Dec 23, 2017 at 2:31am
Dec 23, 2017 at 2:31am UTC
Dec 23, 2017 at 3:20am
Dec 23, 2017 at 3:20am UTC
JLBorges
(13770)
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.