c++ - How to assign a `const char *GetVersion()` (from a third-party library) to a variable? -


how assign variable value of const char *getversion()?

i using third-party library states const char *getversion() available. below code compiles successfully:

#include <iostream> #include <windows.h> #include "thirdpartylibrary.h"  int main() {     const char *getversion(); } 

how assign const char *getversion() variable?

update

char const *getversion()

the version of application manual interface has loaded running extension. version distinct api version, documented in macros , below.

your code compiles since compiler understands

const char *function(); 

as being function prototype.


first of all, read documentation. looks can write

const char* my_variable = function(); 

but check if need release memory. (my hunch don't given return type const, perhaps need call library passing my_variable parameter).


Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -