I need to convert a DWORD into 4 bytes to send to serial RAM. All the examples of using SPIRAM, EEPROM and FLASH use *variable to send and receive. I can break the DWORD down into bytes which I stuck in a char[3]. I don't, apparently even with all my books and Google, know how to convert to a *variable. How is this done?

I always copied it into an unsigned char 4-byte buffer

DWORD dwValue = 123;
unsigned char buf[sizeof(DWORD)];
memcpy(buf,&dwValue, sizeof(DWORD);

Or you could just typecast a pointer
unsigned char* ptr = (unsigned char*)&dwValue;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.