back again with a "using C in C++" kind of question. In my experiment to use APR in C++ I am facing a new issue. The C++ header file:
#ifndef TEST_STRINGCOMMONS_H_
#define TEST_STRINGCOMMONS_H_
namespace test {
class StringCommons {
public:
static char* substr_offset_length(apr_pool_t *pool, const char* input,
apr_size_t offset, apr_size_t length);
};
} /* namespace test */
#endif /* TEST_STRINGCOMMONS_H_ */
and the C++ implementation of it:
namespace test {
...
char* substr_offset_length(apr_pool_t *pool, const char* input, apr_size_t offset, apr_size_t length)
{
apr_size_t *input_length = apr_pcalloc(pool, sizeof(apr_size_t));
...
}
} // namespace test
By compiling this class I get the error:
error: invalid conversion from ‘void*’ to ‘test::apr_size_t* {aka long unsigned int*}’ [-fpermissive]
I would like to know what is wrong with this code. Somebody help me please.
Best regards, SK