I have an odd linker error compiling with Clang.
I'm actually trying to build a clang tool and I am linking against a freshly built set of clang libraries which I can verify do indeed have the...
Type: Posts; User: scarecrow
I have an odd linker error compiling with Clang.
I'm actually trying to build a clang tool and I am linking against a freshly built set of clang libraries which I can verify do indeed have the...
[edit]: I solved this - my test was broken and you were correct in your assertion about free store and static initialisation values. Thanks!
Can you tell me where to find this within the ISO standard?
The definition is within a class member function in this particular case. I do understand how to correctly initialise it, and I always...
Hi,
After coming across some dubiously safe code I've been scanning the C++ standard but cannot find any definitive reference to what the value of an uninitialised char[N] will be. Is it...
That is how I have done it in the past - just wanted to see if there was perhaps another trick.
Great.
Thanks for all the help guys. It seems to be working great.
Interesting. Curious about your line and file parameters there - assuming you were to use __FILE__ and __LINE__, would this mean every time you wanted to allocate some memory you'd have to type that...
Well that becomes a problem also - you will need to integrate with a users browser to set cookies and such. So unless you want to only use your own browser, you'll have to learn to do this for every...
And suddenly I realise how simple and stupid my problem actually was. Thanks for some perspective.
So would I always allocate exactly 16 bytes? Or should I weight this to increase more (in...
Unless you're planning to use some browser fault to inject and run code on the client platform this is certainly not a C++ problem.. And if you did want to do that, it'd hardly be ethical to show you...
Well yes, that's a given. But how can I determine how much is in fact deallocated?
I'm actually not really worried about memory leaks, I'm quite cautious when writing my code - however I like the idea of tracking a leak detector - for curiosity's sake if anything.
If it is...
Is there an easy way to determine how much memory an object is allocated? If I overload delete on an object, from which other objects are inherited - can keep track of how much memory is deallocated...
Well it's a variable.
You're getting a segfault because you're going out of bounds of your array.
Agreed.
To visualise your problem, let's assume I passed in 2 file names, file.a and...
Can you post the actual console output?
Also, define "doesn't run anymore"...
Shouldn't you have received an undefined ref. to regrowth??
Was the class specifier lost in translation, or is your code actually this way (sans forest:: ):
int forest::regrowth(double growProb)
{
double rannum;
...
Where do you define grid? (ps; is regrowth supposed to be a member of forest?)
I have attempted to create a simple object that represents a thread and wraps around the pthread API to execute itself. I'm having a bit of trouble though.
If I inherit the object and reimplement...
Actually I have rewritten it to return const T&, because it avoids problems in tracking data size of elements stored internally for one.
Thanks for the heads up on the potential IDE problems - I...
I see - so there's no RTTI involved with templates and an actual function matching the types I'm passing is created at compile time which all subsequent calls are then pointed to? So I only have to...
I'm having an odd problem with my code. I have a template function in my class.
This is in the header file lcmp.h as so:
class LCMPMsg{
public:
...
template <class T> T*...