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...
Type: Posts; User: bean66
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...
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...
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...
so something like this:
template <class c>
class a {
public:
a(int num) {
_b = new c(num);
}
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...
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;
I'm obviously new to C++ and learning.
Thanks for your help.
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;
};
Thanks Anon! That was the problem exactly.
For others: this was done using MSVS 2008...
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...
Thanks Daved, that helped.
I did not know arrays where not polymorphic.
I'm writing a thread pool class containing the following:
class ThreadPoolWorker {
friend class ThreadPool ;
public:
virtual int initialize() = 0 ;
virtual int finalize()...
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...
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...
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...
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...
private:
struct node
{
static const int values_size_lb =
(NODE_SIZE - 2*sizeof(node*) - sizeof(int))/sizeof(T);
static const int values_size =
...
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...
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...
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....
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...
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...
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...
You called srand after rand.
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 ...