Search:

Type: Posts; User: CodeSlapper

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. std::atomic_flag vs std::atomic question

    I see that the atomic_flag is guaranteed to be lock free. A atomic boolean is not.

    I'm trying to get an understanding when one should be used over the other. If one uses the atomic boolean should...
  2. Replies
    3
    Views
    1,621

    Nothing per se, other than are they battle tested...

    Nothing per se, other than are they battle tested logger or are there others that are aside from using something like boost?
  3. Replies
    3
    Views
    1,621

    Looking for a Logging class

    I'm looking to use a logging class with a license that allows its free use.

    I have looked at Easylogging, GitHub - easylogging/easyloggingpp: Single header only C++ logging library. It is...
  4. I am using a mutex lock on the data I am using. ...

    I am using a mutex lock on the data I am using.

    Here is my thought on the flag. If one thread is only reading it and the other is only going to make a decision when it is true, is a lock still...
  5. Using flag between two threads locking question

    I am working in VS2015 with C++11.

    I have two threads going, and one is adding data to a queue. I have another function setting a flag of when i want to send all the data over. This variable is...
  6. Replies
    4
    Views
    710

    The calls to IX_xxxx are the vendor's drivers and...

    The calls to IX_xxxx are the vendor's drivers and I can't really change what parameters they need. It may make sense to make this a char*, since every driver I have worked with usually does that.
    ...
  7. Replies
    4
    Views
    710

    Help with OO instrument setup

    I'm working on making a class for an instrument I'm working with. This is done with a driver from the vendor.

    Once I get the class done I will work on making some sort of GUI to see if my...
  8. Replies
    6
    Views
    1,106

    Ok, I used some of functions in the vector...

    Ok, I used some of functions in the vector container library, a lambda function and the std::less function. The replies have been helpful.

    There is a lot of syntax to learn in C++, that's for...
  9. Replies
    6
    Views
    1,106

    Thanks for the help, and I can get it to work...

    Thanks for the help, and I can get it to work like that, but I'm trying to get it to work more abstractly, if that is a word.

    templates - C++ Get Vector type - Stack Overflow

    They are using a...
  10. Replies
    6
    Views
    1,106

    Issue with function pointer and template

    The template at the top is giving me an error when I go to compile using the sort function. My guess is the compiler needs to know what data types are going to be used at compile time.

    Is there a...
  11. Start a timer and ignore input for 2 seconds or...

    Start a timer and ignore input for 2 seconds or only take the last one entered? The code you have it a bit hard to follow what it is you want.
  12. Replies
    2
    Views
    885

    I added in using a template for SquareNumber....

    I added in using a template for SquareNumber. Coming from using mainly c for years, I'm finding this to be so cool.


    // IntDoubling.cpp : Defines the entry point for the console application.//
    ...
  13. Replies
    2
    Views
    885

    Advice on Accelerated C++ problem 4.2

    I'm starting to practice using C++, and have read some info on using C++11 and am trying to use it a little bit.

    I tried to follow the intent of the problem and did not use pow from <cmath>.
    ...
  14. Replies
    2
    Views
    934

    You can try that example with double and float...

    You can try that example with double and float and change the precision in the print statement to see how it affects the displayed value.
  15. An array has more info to it than a pointer,...

    An array has more info to it than a pointer, hence why sizeof() works on it.
  16. Replies
    25
    Views
    9,658

    After this comment, you really should play...

    After this comment, you really should play entering different values on one of those online calcualtors and see how the precision varies.
  17. Replies
    25
    Views
    9,658

    You can try to print the long double in hex to...

    You can try to print the long double in hex to see if the computer is printing it out how you expect. floating point - Convert ieee 754 float to hex with c - printf - Stack Overflow may give you some...
  18. Replies
    8
    Views
    2,021

    http://http://stackoverflow.com/questions/1674032/...

    http://http://stackoverflow.com/questions/1674032/static-const-vs-define-vs-enum

    This post discusses the benefits and cons of each method. It seems an enum would be the best option here.

    Your...
  19. Thanks for giving me some confidence.

    Thanks for giving me some confidence.
  20. Replies
    8
    Views
    2,021

    I agree and avoid using #define if possible. It's...

    I agree and avoid using #define if possible. It's better to use const int in this case since you can see the value while you are debugging.
  21. Replies
    8
    Views
    2,021

    I noticed you using the wrong format specifier...

    I noticed you using the wrong format specifier for printing the sum and you had a index for Raindata. You might want to change sum to float, but I left it as an int since that's what you had.

    ...
  22. What C++ book to get with a C background

    Back when I graduated undergrad, 10 years ago I did some C++ for a CS minor. At work I've mostly done C with some small C++ projects.

    I purchased Accelerated C++ and it's on the way. I'm...
  23. Replies
    1
    Views
    693

    Example of Error Handling

    I've been doing some reading on error handling, and I tend to use something like this at work when I'm working with various pieces of equipment, sockets, etc.

    I would think this is probably...
  24. Replies
    3
    Views
    931

    See if this works for you. I got rid of the do...

    See if this works for you. I got rid of the do while loop and made the variable names a bit clearer.


    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    int main()
    {
    ...
  25. Break the problem down. 1. You need to find...

    Break the problem down.

    1. You need to find the word Chapter.
    2. You need to find the file ending position for Chapter (either another chapter or eof).
    3. You need to copy the contents...
Results 1 to 25 of 112
Page 1 of 5 1 2 3 4