Search:

Type: Posts; User: EvilGuru

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    8,090

    Thanks! That did the trick. Regards,...

    Thanks!

    That did the trick.

    Regards, Freddie.
  2. Replies
    8
    Views
    8,090

    std::map Alternatives

    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.
    ...
  3. Replies
    21
    Views
    2,810

    Thank you very much for all of your help! ...

    Thank you very much for all of your help!

    Regards, Freddie.
  4. Replies
    21
    Views
    2,810

    If I am understanding your quoted statement...

    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...
  5. Replies
    21
    Views
    2,810

    I guess it is best if I explain my design and see...

    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...
  6. Replies
    21
    Views
    2,810

    Pointer-to-member functions

    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...
  7. Replies
    4
    Views
    9,242

    I found the article as well during my...

    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...
  8. Replies
    4
    Views
    9,242

    Problem with TIOCMGET ioctl

    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,...
  9. Replies
    31
    Views
    4,240

    Well, I felt luck, and it worked! Question is,...

    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...
  10. Replies
    31
    Views
    4,240

    Well, to be honest I am not totally sure on the...

    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...
  11. Replies
    31
    Views
    4,240

    Portable Doubles

    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...
  12. Thread: SIGIO How-to

    by EvilGuru
    Replies
    5
    Views
    12,649

    After looking around the net I came across a...

    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...
  13. Thread: SIGIO How-to

    by EvilGuru
    Replies
    5
    Views
    12,649

    Okay, thanks. How do I find out for what file...

    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.
  14. Thread: SIGIO How-to

    by EvilGuru
    Replies
    5
    Views
    12,649

    SIGIO How-to

    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...
  15. Replies
    11
    Views
    11,497

    It is a well known fact that a common enemy to...

    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,...
  16. Replies
    11
    Views
    11,497

    Thank you very much. It all seems to work fine...

    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:
    ...
  17. Replies
    11
    Views
    11,497

    I made this quick test function (well program) to...

    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...
  18. Replies
    2
    Views
    878

    What you are talking about is called a GUI and it...

    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....
  19. Replies
    11
    Views
    11,497

    Removing Leading & Trailing Whitespace

    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...
  20. Replies
    5
    Views
    3,227

    I did not use fgets as I do not know how much...

    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...
  21. Replies
    5
    Views
    3,227

    Reading Input From stdin

    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...
  22. Replies
    1
    Views
    1,351

    Printf Trouble

    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...
  23. Replies
    4
    Views
    1,984

    Yes, that was the site that I came across when I...

    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...
  24. Replies
    4
    Views
    1,984

    Inline Functions

    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...
  25. Replies
    5
    Views
    1,918

    When calculating very large factorials you might...

    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 =...
Results 1 to 25 of 42
Page 1 of 2 1 2