Hi,
Looking through some code, I found a function of the format:
int function (parms..., (void *)0, parms...);
Is this legal? I have a need to pass a constant to a function and I really don't want to define a variable to hold it. I have a function that will either read or write a device...
Hi all,
I am in the process of reworking some of my code so that some of the more resuable functions are collected into libraries that will be linked in with multiple applications. One of these functions is a serial port driver and the way it is set up, it requires access to several flags and...
Hi everyone,
I hope this isn't too elementary for everyone, but what is the absolute strictest "proper" way to declare a C function and to access it in a separate file? Assume I have been sent to a military Catholic school for C programmers :-) (Actually, we're looking at DO-178, something...
Hi everyone,
Please forgive the simple question, but if I have a declaration, such as:
const int UPPER_LIMIT = 127;
is the *best* policy to have it in caps? I usually do it in:
#define UPPER_LIMIT 127
and am wondering if the same thing should apply to a const variable?
Thoughts?
Jason
Hi everyone,
Sometimes, I have need for a #define that really only applies to a single subroutine, so I would like to keep it with that routine. In general, I believe that #defines go at the top of a C file, so is there a good "proper" way to place the #define within the C routine? Should I...
Hi everyone,
Sorry if this is too simple, but I am trying to figure out how to access an array of strings, using an index for the string. I have:
typedef struct
{
PARMTYPE parmtype;
_iq* parmptr;
int num_indices;
const char *(indices[10]);
// const char *indices;
} PARMTAB;
and I...
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.