So, apparently when casting an array of bytes, C automatically reverses the endianness:
#include <stdio.h>
#include <stdint.h>
int main(){
uint8_t a[4] = {0x52,0x4a,0x75,0xd8};
...
Type: Posts; User: midyro edellve
So, apparently when casting an array of bytes, C automatically reverses the endianness:
#include <stdio.h>
#include <stdint.h>
int main(){
uint8_t a[4] = {0x52,0x4a,0x75,0xd8};
...
Ah, I see. No big problem, I just wanted to see if it could be done and how. Thanks!
What I'm trying to do is make an array of functions, and initialize it with "anonymous" functions. That is, the function is only defined inside of the array. I currently use an enum to simulate...
Jeez, that was the problem. Thanks!
I need something like this:
#define x 5;
struct A{
int array[x];
};
void main(void){
That's a very awesome trick, thanks! I should really pick up a book about #defines...
For those interested, heres my code now (structs have been typedef'ed, as well as some other minor tweaks):
...
I have some code that I need to duplicate for several structs, and I don't want to manually copy/paste, then search and replace the words.
I have a container object, a struct scene, which holds...