Thank you John.c.
Type: Posts; User: Dino
Thank you John.c.
I've searched around, and have yet to find an example, so I'm thinking maybe it can't be done.
What I want to do is parse an individual argument, like x, passed to a macro.
For instance, ...
OMG. Never mind. I had a typo in my program. This works great when my spelling mistake was fixed. I had this:
#ifdef _MYVAR_
#define MODIFIER static
#else
#define MODIFIER...
I'm wanting to conditionally assign a modifier during a compile. I want to assign a modifier of "static" or "extern", depending on whether a given symbol is defined.
That is what I'm trying...
Ah yes, I see this now. No man pages on the system I'm using! Not all development systems are *nix.
Thank you!
If I am testing a bit (and please don't tell me better ways to test a bit - I know there are), are the inner parens redundant here?
if ((work->flagbyte & 0x80) ==0) { ... }
I said it was "ignored" because the end result was the same. I wasn't aware that I could use &array. I've always just used array or &array[0]. Now I have a third option.
I was looking at...
#include <stdio.h>
#include <string.h>
...
Yep, thanks. That's what I came up with.
I see that this works.
my_24_ptr = (void *) ((int) my_32_ptr & (int) 0x00FFFFFF) ;
On the processor I am programming on, there can be 64-bit, 31-bit and 24-bit pointers.
I'm trying to extract a 24-bit pointer out of a 4-byte word. The first 8 bits in the 4-byte word can be...
Thank you both for replying. I would have responded earlier, but couldn't - see below.
I went through several test cases to see what is happening and to understand it better. I guess it's...
I appreciate your replying, but IMHO, the pertinent pieces of the question were more than enough to answer. The question was about syntax, style and expression evaluation.
However, I have...
I don't think there is, but is there any difference between the following expressions?
...
unsigned char flag ;
#define BIT0 0x80
#define BIT1 0x40
...
So simple!!
If a guy wanted to buy you a bottle of your favorite libation, for appreciation of all the times you've helped me, how would he do that?
I'm stuck on how to fix this. The program does not work, and I know why, but I don't know how to fix it.
It's not working because of this line:
tempptr += ( tempptr->glen +...
Is there a way to declare space in a struct as unused / filler / pad, in such as way as to not have to provide an identifier?
For example,
struct foo {
int . ; // just 4...
Clever! My platform is big endian. Will never be ported to another platform. I forgot about shifting. Thank you.
I have a 3 byte unsigned char array that contains a length value (someone else's control block) and I need to move the value to my int field.
I tried different flavors of casting, but couldn't...
Actually, my list_entry is not doubly linked. I had it doubly linked, but realized it was overkill in this scenario.
I'm creating a doubly-linked list that is contained in blocks that are doubly-linked as well.
When I create a block, (aka, a header), the caller specifies the length of his data that will go...
Works perfect! Great solution. Thank you!
Here's the scenario.
I have some structures...
struct entry {
char name[8] ;
int age ;
} ;
That’s what I was expecting, but wasn’t certain. Thx
In the #define solution above, will the, for instance, B500 fields, since not directly used, be part of the executable, affecting the final size of the executable?
In assembler, I code this:
...