What is the equivalent of C++ '*&' in C ?. Does it even exist?
for example, how to implement this C++ code in C ?
void someFunction(type *&outParamOnly) ;
returnType someOtherFunction() ;
...
returnType someOtherFunction()
{
type *data = NULL ;
someFunction(data) ;
...
}
...
void someFunction(type *&outParamOnly)
{
bool condition ;
int array_len ;
...
if(condition) // variable's value passed to this function stays as it was
return ;
...
outParamOnly = new type[array_len] ; // value is moddified and it's
reflected in 'someOtherFunction'
...
}
...
I'm asking because I don't know how to create such equivalent. Does it's
complex ?. In fact I don't know much about C, but much more about C++
syntax, etc. I'm used to write in C++ and once I tryied C to feel
diffrence I'm not doing well when trying to implement what I want. I
expect positive answer - that it possible to create some equivalent, but
will it be running faster then in C++ or slower ? Please answer.
No comments:
Post a Comment