Regarding NULL, have a look at this post (or at that thread as a whole).
Type: Posts; User: migf1
Regarding NULL, have a look at this post (or at that thread as a whole).
To expand on Laserlight's post, if struct Vector is meant to be implementation detail, define it in a .c file (perhaps where your main() function is implemented).
You are welcome.
You should always check the documentation of the functions you are using. If you don't have direct access to the docs, then a simple google lookup is usually all it takes. For...
Lines 35 to 37 are in the right direction. Try removing the asterisk when you define the buffer, and also pass 21 as the 2nd argument to snprintf().
The address of a pointer is a double pointer, so try coding a different swap() function which will accept double pointers as arguments (and adjust accordingly the code in the function body).
I was referring to C99's format modifiers for printf (PRIxx). glib for example provides its own modifiers (which btw are not necessarily better and/or easier to remember than C99's).
...
This kind of info should be presented/explained in the docs. If not, I guess you can either contact the author directly (or the community forum of the lib, if there is one), or dig into the source...
Actually it provides more functions, just checked. sp_last_error_message() looks quite handy (similar to perror() but not exactly... also you have to sp_free_message() afterwards). Also, using a...
Assuming that the prototype of the function is something like the following:
whatever enum_ports( sp_port ***ports);
then the code above sounds about right.
Perhaps you should check whether...
Your code is more complicated than it needs to be, and thus more error-prone (as you have already discovered ;) ).
Follow Laserlight's advice. Even if you are not allowed to use <string.h> and you...
The latter. For guaranteed widths use the exact-width types.
Yes, in this case you indeed need the extra asterisk when defining the function enum_ports()... and consequently the address-of operator when passing ports into the function.
PS. Regarding...
If your code does not depend on explicit type sizes, then no, you don't have to worry. If it does, then using C99's <stdint.h> (as you write below) is a bless from God :)
<stdint.h>'s *N_t...
Almost right :)
In the scope of the function, *list_ptr is the array itself. The line *list_ptr = NULL; initializes to nowhere the not yet allocated array. There are no array elements at that...
We were cross-posting.
The article says that when it was written, on x86 machines the sizeof an int was 4 bytes. It doesn't imply that this is always true.
Yeap, they are exactly the...
This makes sense only if sp_list_ports() does NOT consider as error the case where no ports are found. Which in turn means that even when no ports are found, the functions allocates the ports array...
Actually, according to the documentation of the function sp_list_ports(), the ports variable should be defined of type: struct sp_port **
It's my understanding that the function dynamically...
If that's the sp_list_ports() you are using, then it does not return a pointer. It returns an enum value (defined here: libserialport: libserialport.h Source File).
There's not really right or wrong way to go. Whatever suits you best!
Actually I assumed you were using mingw on both platforms (Linux and Windows). If you were, I guess you shouldn't need to...
As I said, I don't really have adequate experience with GTK+3, but it's been heavily criticized from what I've read. Some people even say that it's a step forward and 2 steps backward. Rumors also...
Oh, I see. Well, you can only get drafts for free. Have a look here for links (in general google for "iso C?? standard pdf" or "download instead of "pdf").
EDIT: Actually, they're also listed in...
It seems like the guys over there have already answered your questions. They have also given you a link to gcc-avr's ABI & extensions docs. What else do you need?
Advanced makefiles isn't my strong pointer either, so I think it would be easier to just have 2 separate makefiles, one for x86 builds and one for x64 builds. I think this approach would yield in...
I just re-read my last post and I realized that you may conclude that you cannot connect both a key-press and a mouse-button press signal handler to your window (or any widget for that matter). You...
Yes, that's what the above code is supposed to do. You first respond to the "key-release-event" via the signal-handler function, and then inside that function you extract all the info related to the...