Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Declare dll problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01437269
Message ID:
01437499
Vues:
46
> 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);
}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform