Ivan said:
it is an embedded system, I thought there was a standard way of doing it,
well I suppose I'll have to contact them to know how to do it.
thanks you all
Then Johnathan is correct. The main issue I see is the potential
misalignment.
Assuming you do in fact have direct hardware access, and that you really
want an unsigned at that alignment, you should use one of the two
constructs:
// C style (you did crosspost to c.l.c)
unsigned int *const wPtr = ((unsigned int *)0x3ff);
or
// C++ style (you did crosspost to c.l.c++)
unsigned int *const wPtr = reinterpret_cast<unsigned int *>(0x3ff);
if 0x3ff is a read-only memory address, make it
unsigned int const *const wPtr = ...;
If 0x3ff is a memory mapped register, which can change under you, make
it volatile as well (volatile goes before the * in the declaration, both
sides of the assignment).