DaveSinkula,
Maybe something interesting would be cautions of where you can go wrong with void * (or would that be too unbounded of a question to ask of C? )
*That* link is very helpful, but not yet, as I will have to read it 3-4 times I think. [dazed] Thanks!
OK, for array a
pa = &a[0] is the same as pa = a and pa = (a+0)
but
pa = &a is not *exactly* the same as pa = a.
I’ll have to check over my code in a new light.
I have no...
DaveSinkula :
More precisely it works on project code my C18 compiler. Maybe my there is a subtle difference between my project and sample code. Maybe there is a tiger trap waiting for me in my code.
So, if a is an array, then pa = &a[0] is the same as pa = a, but what about pa = &a...
That got it working! (I left the & in)
Dang, I was so fixed on going through the top struct, that I didn't consider going through the lowest struct. Blind! Since I have to know the whole "path" to the lowest struct via the highest, there is actually *less" dependency just referencing the...
I beg patience as I try this again,
I use a set up where each static object consists of a struct of pointers to various struct
struct X {
struct X1;
struct X2;
struct X3;
….
};
struct Y {
struct Y1;
struct Y2;
struct Y3;
….
};
The Problem: This has worked very well for me, but now I...
OK, DaveSinkula,
What you have is pretty much what I tried, and should work. But let’s take it you the next notch to what I really need. I deal with the fact that I can’t have RAM and ROM in the same struct, I and another layer of struct that points to my RAM struct and ROM struct for each...
ChipperMDW,
You are giving me very educational suggestions, but we're not there yet.
>How about just writing a function that takes a struct B *
>and returns the address of its b member?
That is a very interesting idea. But I neglected to enphasize that the initialization must be in ROM. To...
chipperMDW:
Background: I have been an assembly programmer of 5 years experience. My C is completely self-taught out of Kernighan and Ritche and only have a couple of recent embedded C projects under my belt (C51 and PIC16).
I have not used the code you suggested because I expect information...
I have a project where I want to have the two general types of structures:
struct A {
…
unsigned char *a;
…
};
struct B {
…
unsigned char b;
…
};
The general idea is that...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.