'Invalid conversion from some_type** to const some_type**'
Posted
by petersohn
on Stack Overflow
See other posts from Stack Overflow
or by petersohn
Published on 2010-04-20T07:59:53Z
Indexed on
2010/04/20
8:03 UTC
Read the original article
Hit count: 184
I've got a function that requires const some_type**
as an argument (some_type
is a struct, and the function needs a pointer to an array of this type). I declared a local variable of type some_type*
, and initialized it. Then I call the function as f(&some_array)
, and the compiler (gcc) says:
error: invalid conversion from ‘some_type**’ to ‘const some_type**’
What's the problem here? Why can't I convert a variable to const?
© Stack Overflow or respective owner