|
Tree container library Hello, Feeling a need for a generic tree container to supplement the available containers in the STL, I've created a generic tree container library (TCL). The library usage is very much like the containers in the STL, including iterator usage. Info on the library can be found here.. http://www.visuallandlord... 4 Jan 2006 08:48
template.cpp:9: error: too few template-parameter-lists I tried to compile the following code with g++ 3.4 and 4.0 and got the error: #include <iostream> template <class T> class X { static X<T> * xp; }; X<int> * X<int>::xp = NULL; int main() { return 0; } with g++ 3.2 it works was something changed in the compiler or in c++ standard? do I need to wr... 14 Dec 2005 16:28
generate double persision random value After searching to no evail for an answer to generate double presision random values I come here for assistance. I am still very new to C++ and have a situation where I need to generate a radom number that contains a fractional part. I have the following statement: currentValue = minValue + (rand() % maxValue);... 27 Dec 2005 14:03
64 bit integer Hello, I am sure that this question has a quick and easy answer but it's driving me nuts. I need to to store 19 9's in an integer, so i need an unsigned 64 bit int. In windows vsc++ compiler the code would be: _int64 test = 9999999999999999999; I am now using g++ version 3.3.5(Suse 9.2's) I have tried both... 14 Dec 2005 07:29
Anybody know anything about Stacks? I'm trying write a program that outputs an appropriate message for grouping symbols, such as parentheses and braces, if an arithmetic expression matches. For example, the expression {25 + (3 - 6) * 8} contains matching grouping symbols. [ See http://www.gotw.ca/resources/clcm.htm for info about ] [... 2 Dec 2005 21:19
Portable way to write binary data Hi all, I was shocked when I read to thread "For binary files use only read() and write()??" above, in which was stated that using read()/write() for binary data is unportable and may lead to undefined behaviour (!!). I always thought myself to be on the safe side by doing things the following way: - Use s... 28 Nov 2005 16:39
SHA1 I am trying to implement SHA1 based on the pseudo-code on Wikipedia. The pseudo-code is on: http://en.wikipedia.org/wiki/SHA-1 My code is working, but is not giving me the correct hashes. This is being tested (initially) on a big-endian machine, and only after I have it working on big-endian was I planning on m... 24 Nov 2005 12:47
reading entire file to a string I have some old code (that works just fine!), but it uses FILE* and CString to read the contents of a relatively small file to a string in a single call. Its signature is: bool ReadFileToString(const CString& csFilename, CString& csContents); I'd like to change that, though, to use std::string and std:ifstrea... 21 Nov 2005 05:46
realloc's design In sutter's C++ Coding Standards, he has gave realloc as an example in item5, he said "In Standard C, realloc is a infamous example of bad design. it has to do too many things: ..., it is not easily extensible. it is widely viewed as a shortsighted design failure." why the realloc is the bad design? From the u... 22 Nov 2005 06:41
hash_map Please, help me, i'm new to this. I want to do hash_map, where key will be unique structure... struct key { long data[3]; } ....and the value will be unsigned char; How to do efficient hash function which will return first 20 bits of data[3]?? So my hash will have table of 1048657 elements... *) I... 13 Nov 2005 10:42 |