Initialization of pointers in C#
Forums:
unsafe
{
int i = 50;
//pointer to int value
int* pInt;
pInt = &i;
double d = 3.14;
//pointer to double
double* pDouble = &d;
long* pLong;
//*pLong = 12345; //<-Error
//pLong = 0xB8000000; //<-Error
//address for the pointer
pLong = (long*)0xB8000000;
}
- Log in to post comments