Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declare dll problem
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01437269
Message ID:
01437499
Views:
45
> Why do you think that it points to the array of bytes? There's no [] in declaration.

There is no [] in the following code. Still it prints the whole array -- 12345
#include "stdafx.h"
#include < conio.h > 

void PrintBuffer(unsigned char* buffer);

int _tmain(int argc, _TCHAR* argv[])
{
	unsigned char* buffer = (unsigned char*)"12345\n";
	unsigned char* buffer1 = (unsigned char*)"larger array\n";
	PrintBuffer(buffer);
	PrintBuffer(buffer1);
	getch();
	return 0;
}

void PrintBuffer(unsigned char* buffer)
{
	printf((const char*)buffer);
}
Previous
Reply
Map
View

Click here to load this message in the networking platform