www.digitalmars.com         C & C++   DMDScript  

c++ - a c++ pointer question

reply A Bothe <info alexanderbothe.com> writes:
Hey everyone,
I have a question concerning pointers...

void b(PULONG v)
{
	ULONG t=64;
	v=&t;
}

void a()
{
	PULONG v;
	b(v);
	ULONG t=*v;
	if(t==64) MessageBoxA(0,"OK","",MB_OK);
}

when I compiled it, t isn't 64...how can I get that working
correctly? (Yes, I want to use pointers, not return values)
Jan 11 2010
parent A Bothe <info alexanderbothe.com> writes:
Solution found :-)

it has to be

void b(PULONG v)
{
ULONG t=64;
*v=t; // Here was the error
}
Jan 11 2010