Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

*& in declaration

Status
Not open for further replies.

sem

Programmer
Jun 3, 2000
4,709
0
0
UA
I've got a DLL and header file, that contains
extern "C" {
//some other delarations
__declspec(dllexport) int __stdcall myfunc (unsigned char*& p1);
typedef int (__stdcall* PROCESS)(unsigned char*);
}

It's apparently for C++, but I need to use it in C program

I replaced this declaration by
SLIB_API int __stdcall process (unsigned char** p);

Does anybody have an idea why this doesn't work?



Regards, Dima
 
Try replacing it with

unsigned char* p1

If that is not it, the only other thing it MIGHT be is

unsigned char p1

Matt
 
I call it as

unsigned char* m = NULL;
int result = process(&m);

Is it correct?

The working C++ code calls it another way:

unsigned char* m = NULL;
int result = process(m);

The problem is that C compiler complains of *& construct. Regards, Dima
 
C does not understand call by refernece..it is not the C compilers problem to underatnd C++!!!..char c,char &c,char *c,char * &c
C will reject 2,4
 
@sem:
References are pointers internally.
So it should work if you feed the function an ordinary pointer to a pointer instead a reference to a pointer.

Greets,
Tobi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top