P
Paul Kirby
Hello All
I am trying to create a function that returns a string like the following:
// defined in headerfile //
void test_func(char *retstr);
// -------------------- //
// c/cpp File //
#include "headerfile.h"
char * tststr;
test_func(&tststr);
printf("Test Function returned: %s\n",tststr);
// test function //
void test_func(char *retstr)
{
retstr = "test";
}
// ------------ //
None of these seem to return the correct string value.
I use to use this alot ages ago but cannot seem to remember now
So if anyone can help me sort this out please let me know
Thanks in advance
Paul Kirby
I am trying to create a function that returns a string like the following:
// defined in headerfile //
void test_func(char *retstr);
// -------------------- //
// c/cpp File //
#include "headerfile.h"
char * tststr;
test_func(&tststr);
printf("Test Function returned: %s\n",tststr);
// test function //
void test_func(char *retstr)
{
retstr = "test";
}
// ------------ //
None of these seem to return the correct string value.
I use to use this alot ages ago but cannot seem to remember now
So if anyone can help me sort this out please let me know
Thanks in advance
Paul Kirby