First  |  Prev |  Next  |  Last
Pages: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
64-bit Random Number Generator
Hello; Does anyone know any 64-bit number generators that work on 32-bit machines by using long long or __int64 ? -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ] ... 3 Jul 2008 10:26
How to avoid multiple definitions of global variable
Hi. I need some help with my understanding of code structures and scopes. g++ tells me that a namespace-global variable (ABC::a) either has "multiple definitions" or is "not used" if I change the type to static. Either way I don't understand why? 1. Why do I have to make it static? 2. If static is the answer ... 27 Jun 2008 16:16
Division result is always 100 instead of 99.99
Hi All, My coding have following stmt in which I divide large number say X by number y which is sligthly greater then X. Say Y = X + 1 double successRate = 0; double passedCandidates = 10000000 ; double failedCandidates = 1; sucessRate = (passedCandidates * 100) / ( passedCandidates + failedCandidat... 27 Jun 2008 15:14
Can class have a member vector of itselfs?
class Test { public: void Add(const Test& t) { m_vec.push_back(t); } private: vector<Test> m_vec; }; This compiles just fine using Microsoft's (or should I say Dinkumware's) STL in VS2008 but fails on STLPort 5.1.5 with same compiler. Does C++ standard say something about this? -- [ ... 25 Jun 2008 03:42
Template and Inheritance
Hello, I'm reposting on the moderated list (plus correcting some minor bugs)... Can you help me on this... Is there a way to fix the problem at the end of the main? If the two extra scalar product operator* were defined for scalar types only, it would be perfect. Can this be possible? I manage to merge the ... 25 Jun 2008 06:46
trouble with structs
Hi, I need some simple help. First, I should apologize: I am a total programming fool in C++ and am trying to get some basic structs working before I attempt classes. I can't seem to get the references to those structs working properly and need help. Suppose I have: struct info { int color; int count; }; ... 23 Jun 2008 16:51
How is common_type (N2615) supposed to work?
>From the proposal for new time classes (N2615) http://www.open-std.org/jtc1/sc22/WG21/docs/papers/2008/n2615.html#common_type I get this common_type traits template <class ...T> struct common_type; template <class T> struct common_type<T> { typedef T type; }; template <class T, class U> struct c... 26 Jun 2008 14:37
need template help
i need to write a function which has the following behavior: blah<false>(x) -> returns x.begin() // x is a containter (vector, map) blah<true>(x) -> returns 0 // x is an integer (short, unsigned long long) i've been trying different combinations, but i don't know how to specify the return type. here is one of... 22 Jun 2008 21:24
encapsulating related utility functions
One of the things I like about C++ is that it doesn't force you to create fake "objects" in the OO sense. We had a debate at the office about the "right" way to encapsulate related utility functions (such as additional math functions). These would pure functions with no state. 1) Create a class with all st... 25 Jun 2008 20:09
question on assignment
I am inputing a year value and I want to create two variables, one only taking the first two digits of the year and the second taking the last two digits of the year. So, for example, if I input year = 1999, I want to assign the first variable the value 19 and the second variable 99. How do I do this? Thank... 21 Jun 2008 19:55
First  |  Prev |  Next  |  Last
Pages: 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48