Thanks for the link, it works great now! That was a lot simpler of a solution that I expected.
Type: Posts; User: LyTning94
Thanks for the link, it works great now! That was a lot simpler of a solution that I expected.
I'm trying to define a variable type at runtime based on user input, so what I did was created an abstract base class Variable and derived a templated class from it.
class Variable
{
public:
...
While looking for ways to compile GMP in VC++, I stumbled across MPIR, which is a Windows-based version of GMP. I compiled that in VC++ and everything worked great. I haven't tried it out yet, but...
Okay...is there any way to link to this file in VC++?
I tried this, and it appears to compile fine. I ran 'make check' and all the tests were successful. I then ran 'make install', which as far as I can tell should have installed the .lib file to...
I tried to compile GMP on cygwin, but I'm getting the following errors:
I checked, and the file libgmp.la does exist at that path. I used
./configure --enable-cxx
make
to compile.
Is there a library out there that lets you store numbers that are too big for a long long? This is all theoretical--I don't actually have a use for it, I'm just wondering if it's out there.
Your first statement shows that you have no conception of what religion even is, which puts you in no position to pass judgement on it. Not to mention that I was talking about a moral issue, and...
I did not write the code myself, but here is the grow array function which is called each time an object is added to the container:
template <class T>
void FFreeListTrashArray<T>::growArray()...
Okay, I don't want to go completely off-topic here, but this statement really offended me. Comparing a programming strategy to a real-life moral issue is a terrible analogy. Not to mention that...
Meaning...?
Can you create an array of templated, resizable containers? For example, would this array work?
TemplatedContainer<ExampleClass>* ptr;
ptr = new TemplatedContainer<ExampleClass>[value];
...
Okay, thanks for the suggestions.
The problem is I'm modding a dll and don't have access to the exe code, so I can't track the size of objects whose classes are defined in the exe.
Since you can't use sizeof with a dynamically allocated object, I'm wondering if there's possibly a RTTI function that could return this for me? Or is it not possible?
Just return Count() == 5.
It appears to be working fine now. I guess adding ios::trunc to open() is what I needed. Thanks for the help.
fstream doesn't create a new file by default? This could be the problem...how do I set it to create a new file?
EDIT: I just read that you can't open a nonexistent file for reading, so I guess I...
@rags_to_riches
Yes, the executable is in that file.
@jimblumberg
I'm using Windows XP SP3. And yes to the other two questions.
What's puzzling me even more is that yesterday it worked, but...
std::fstream outputFile;
outputFile.open("Mods/CivTacticalCombat/BattleInfo/UnitInfo.dat", std::ios::in | std::ios::out | std::ios::binary);
FAssertMsg(outputFile, "Error opening...
Someone else familiar with the BTS SDK just told me it would be safe to comment out that line, so never mind.
Well, I'm modding the SDK for Civ4 BTS, so there are quite a few headers used. I searched for #include <, which should bring up all the headers not included in the SDK itself, and here's what I got:...
Yes, I did. I found two different scenarios offered:
1) I'm using a mixture of old and new I/O headers and functions
2) I'm redefining the keyword new
I'm not actually writing a new program,...
I'm trying to use fstream for some file I/O, but I'm getting the following error:
any idea why this is occurring, and how to fix it?
BTW, Merry Christmas to everyone! :)
Instead of
if (path != 0 && < 5)
you need:
if (path != 0 && path < 5)
In other words, the && or || separates two individual conditional statements, not two conditions on one variable.