Search:

Type: Posts; User: bean66

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: debugging

    by bean66
    Replies
    7
    Views
    958

    Thanks for your input everyone. I think i've...

    Thanks for your input everyone.

    I think i've found at least part of the issue. I found a failed memory allocation. But after looking at the code (using a debugger) i found that possibly an endian...
  2. Thread: debugging

    by bean66
    Replies
    7
    Views
    958

    The garbage value is either 101 or 115. And...

    The garbage value is either 101 or 115.
    And generally happens early in the file and sometimes in the same location.
    But once the process stops and i restart then it processes fine.

    Yes i've...
  3. Thread: debugging

    by bean66
    Replies
    7
    Views
    958

    debugging

    Im stumped with a debugging problem, maybe you can help?

    Here is a good description of the problem without code:

    Process one creates a file with records. Each record has a record type and...
  4. Replies
    6
    Views
    1,052

    so something like this: template

    so something like this:



    template <class c>
    class a {
    public:
    a(int num) {
    _b = new c(num);
    }
  5. Replies
    6
    Views
    1,052

    I did that originally using runtime polymorphism....

    I did that originally using runtime polymorphism. But since i create and store an array of elements of type "b" in class "a" it required a friend function/helper and an initializer template to create...
  6. Replies
    6
    Views
    1,052

    template derivation from another class?

    I could use some help with the following concept:
    suppose i have a class that contains virtuals




    class b {
    public:
    b(int n) : _num(n) {};
    virutal int do() = 0;
  7. Replies
    3
    Views
    742

    I'm obviously new to C++ and learning. Thanks...

    I'm obviously new to C++ and learning.

    Thanks for your help.
  8. Replies
    3
    Views
    742

    resolving virtual class for Queue?

    How does one go about resolving a virtual class so that the STL class queue will be able to instantiate?



    #include <queue>

    class Foo {
    virtual int run() = 0;
    };
  9. Replies
    4
    Views
    1,313

    Thanks Anon! That was the problem exactly. For...

    Thanks Anon! That was the problem exactly.

    For others: this was done using MSVS 2008...
  10. Replies
    4
    Views
    1,313

    Compile issue in g++, works fine in VS

    Hi
    The g++ compiler generates the following error output for the code below. This code compiles fine in Visual Studio. Any ideas as to why this code fails in g++?


    factory.h: In member function...
  11. Replies
    3
    Views
    1,849

    Thanks Daved, that helped. I did not know...

    Thanks Daved, that helped.

    I did not know arrays where not polymorphic.
  12. Replies
    3
    Views
    1,849

    Help with polymorphism and arrays.

    I'm writing a thread pool class containing the following:



    class ThreadPoolWorker {
    friend class ThreadPool ;
    public:
    virtual int initialize() = 0 ;
    virtual int finalize()...
  13. Replies
    11
    Views
    1,003

    As I'm new to C++ the initializer list for a...

    As I'm new to C++ the initializer list for a structure is a new concept.

    However after reading the references and looking at this again I disagree that {} indicates an INLINE function. If I'm...
  14. Thread: weird core dump

    by bean66
    Replies
    5
    Views
    1,025

    brewbuck, I think i found the problem here: ...

    brewbuck,

    I think i found the problem here:


    struct node
    {
    static const int values_size_lb =
    (NODE_SIZE - 2*sizeof(node*) - sizeof(int))/sizeof(T);
    static...
  15. Thread: weird core dump

    by bean66
    Replies
    5
    Views
    1,025

    Its strange that this only occurs on linux g++...

    Its strange that this only occurs on linux g++ but not Visual studio. Could this be using an unsupported feature.
    The full source for this is located at:

    Unrolled linked list (C Plus...
  16. Thread: weird core dump

    by bean66
    Replies
    5
    Views
    1,025

    weird core dump

    I'm getting a core dump from the delete when using g++, but MS visual studio executes the code just fine. Any ideas on why this is happening with g++ or better yet how can I debug this. I use ddd/gdb...
  17. Replies
    11
    Views
    1,003

    unfamiliar syntax

    private:
    struct node
    {
    static const int values_size_lb =
    (NODE_SIZE - 2*sizeof(node*) - sizeof(int))/sizeof(T);
    static const int values_size =
    ...
  18. Replies
    2
    Views
    692

    Thanks Mats, Thats exactly what I was looking...

    Thanks Mats,

    Thats exactly what I was looking too see..

    Each structure/Function has a corresponding on disk representation.

    The current code is in "C" so my original thought was to create...
  19. Replies
    2
    Views
    692

    Design for Multi Version of a File.

    I'd like some advice on how to lay out a design in C++ that can handle multiple versions of a file.

    The file will contain enough information to identify version 5 from version 6 in a header. Most...
  20. Replies
    19
    Views
    10,279

    This is seriously flawed. What happens when a...

    This is seriously flawed.
    What happens when a program file has a soft link? or copied?

    Best to use file lock, Semaphore, mutex. Basically the issue is the name is not guaranteed to be distinct....
  21. Replies
    19
    Views
    10,279

    For file based locking: 1. use a seperate file...

    For file based locking:

    1. use a seperate file to control locking! Not the same file used for I/O.
    2. See fcntl (fd, F_SETLK, flock)
    3. use type = F_WRLCK

    Thus the set lock will work for one...
  22. Replies
    2
    Views
    1,584

    for later retrieval by another part of the code....

    for later retrieval by another part of the code. They have a key of a uint32_t which will be hashed, generall access to the root and obj1 will be by the hash. Access to ver1 will by by as an array or...
  23. Replies
    2
    Views
    1,584

    ideas requested for a CACHE.

    Hi all,

    I'm soliciting your input for ideas on implementing a cache.

    This is not an ordidanary cache no sir. I have structs, 1 of which is referenced by one of the others. And one is self...
  24. Replies
    5
    Views
    1,365

    You called srand after rand.

    You called srand after rand.
  25. Thread: I/O interface

    by bean66
    Replies
    0
    Views
    933

    I/O interface

    Hi all,

    I'm looking to write an I/O interface in C that can use the following means to perform I/O.
    open/read DIRECT
    fopen/fread STREAM
    open/mmap ...
Results 1 to 25 of 42
Page 1 of 2 1 2