Thanks!
That did the trick.
Regards, Freddie.
Type: Posts; User: EvilGuru
Thanks!
That did the trick.
Regards, Freddie.
Hi,
In my application I currently use std::map. However, I have found no way to solve the following problems: when an invalid key is passed to operator[] it inserts a new element into the map.
...
Thank you very much for all of your help!
Regards, Freddie.
If I am understanding your quoted statement correctly then it is indeed possible and applicable. How would you suggest that I integrate the static cast into my above example (so to make using it as...
I guess it is best if I explain my design and see if I can come up with a better API. I am currently porting a Python class over to C++. The Python class makes heavy use of introspection.
The way...
I am currently playing around with pointer to member functions but am currently having trouble getting them to work with inheritance. Is it possible to define a member function which takes a pointer...
I found the article as well during my googling-frenzy but it seems to be for kernel modules by the looks of it as opposed to user-space applications.
After a good few hours searching I did find...
Hi. I am currently porting an application which interfaces with a serial port from Windows to Linux. The two main things done are the setting of DTR and the reading of DSR. I am having a problem,...
Well, I felt luck, and it worked! Question is, does anyone known of a smarter method to swap the bytes than this:
void my_htond (double *out, double in)
{
unsigned char *bin = (unsigned...
Well, to be honest I am not totally sure on the formats to tell you the truth. The system it will be running on is an embedded system (Gumstix), which uses an ARM processor. I am not sure if it has...
I am trying to transfer double-width floating point numbers between two computers, whose floating point format is different. Does anyone know of any packages/libraries that will convert...
After looking around the net I came across a presentation, which had a bit of information on it and what appears to be a code example. But I can not make heads nor tails of it.
Snippet 1:
int...
Okay, thanks. How do I find out for what file descriptor the signal is related to and what event has happened. I am looking around for a complete example but have been unable to find one.
Does anyone know of any good references on using SIGIO. I have searched around but have been able to find very little on the subject. I have taken a look at the fcntl man page which gives a bit of...
It is a well known fact that a common enemy to all evil people is whitespace, as it is the one thing that stands between well obfuscated code. :p
I really do like your object orientated approach,...
Thank you very much. It all seems to work fine now! In the end I came up with this function (which works perfectly) and would like to know if you have any suggestions for how it could be improved:
...
I made this quick test function (well program) to test it out however when I run it I get a Bus Error (aka a seg fault). Here is the code that I am trying to use:
#include <stdio.h>
#include...
What you are talking about is called a GUI and it stands for graphical user interface. There are many ways to create an interface, you can use the Win32 API (hard) or a widget toolkit, e.g....
Hi, I need help with removing trailing and leading whitespace from a char array. Does anyone have any advice as to how I should do this. I can remove trailing whitespace by working backwards through...
I did not use fgets as I do not know how much they will type. It could be up to (and if redirecting stdin) over 10k.
I used the number 32 because, well, it seemed like a reasonable number to...
Recently I need a way to read a line from stdin, but it was quite important that I read the entire line (as some of the inputs were quite large). So I decided to have a go at writing a function, that...
I am having trouble getting printf to print out my values correctly. In my program (calculator) I need to print out a load of numerical variables. Now, currently I use the %.*g printf flag, as %.*f...
Yes, that was the site that I came across when I was looking for information on inline functions and was not sure if the GCC way is C99 compliant. I put the wrapper there because it does not really...
I needed to make some wrappers for some functions in my program as my argument structure was different to that of the lib/functions that I had created. It has been suggested that the best way to do...
When calculating very large factorials you might want to use Stirling's approximation (which is much faster), http://en.wikipedia.org/wiki/Stirling%27s_approximation . To do 5! you would do:
n =...