Type: Posts; User: S__B
Search took 0.01 seconds.
December 21st, 2010, 09:04 AM
I don't think this would work, as infinitely many points on "the sphere" will have the same key. So in the end the "find" will be indeterminate.
December 20th, 2010, 06:32 PM
A problem in that case would be that it won't result in something unique. Please correct me if I'm wrong.
December 20th, 2010, 04:45 PM
Perhaps read each line using "fgets" in a while loop, and then interpret it accordingly. If a line has a ",", then break, otherwise do whatever with the line string.
December 20th, 2010, 04:21 PM
Either make the "votes", and "total" doubles, or typecast them as "double" while computing "percent".
December 20th, 2010, 12:21 PM
Thanks Lindley for pointing out a problem.
Paul, you are suggesting a serious flaw in this implementation. I thought that when a value is fetched into an internal register, it is just mirrored...
December 20th, 2010, 11:16 AM
Thanks Lindley for the clarification. In this case, I'm "another code" trying to debug some of the inherited code, without crashing it down.
The situation is that the keys instead of floats is the...
December 20th, 2010, 09:31 AM
QUESTION 1: I think I am missing something here. I am not sure how "map" will use "LessThan" for "find". Can you please explain, or point to a link?
QUESTION 2: How to define a "LessThan"...
December 17th, 2010, 12:17 PM
But if I don't add or subtract anything, it should work? For example,
1. an array initialized with all possible "floating point key values".
2. map initialized with (key,item) where keys are used...
December 17th, 2010, 11:44 AM
I think I don't quite follow this. First, for std::map, I need to define LessThan() not EqualTo(). Correct? (this behavior is opposite to the hash_map, which I normally use) How this translates to...
December 17th, 2010, 11:18 AM
I need to use it for find. In fact, I am debugging someone's code and find this usage, and am a bit skeptical of it. So, I wrote a small test application, which seems to work quite fine. I don't see...
December 17th, 2010, 11:12 AM
I'm a bit confused with the working of map versus hash_map. For the hash_map the "Equal" is used to find the item, whereas the map seems to take "LessThan" as a template argument. Is that sufficient...
December 17th, 2010, 10:53 AM
You are not freeing the memory correctly. Use
delete  secret;
December 17th, 2010, 10:46 AM
It is reasonable to use floating point number as a key in std::map. Would it fail while trying to lookup for a keymap?
If "char* p" is the character pointer, then something like
int n = *( (int *) p );
is what you should be looking at.
I do have two monitors. Although the dialog is supposed to appear on the first one (its previous location as well as that of the VS IDE), I don't even find it on the second monitor either.
Has anyone seen the following problem with VS.NET 2003 while debugging a process? If so, how to resolve it.
When I do:
Sometimes nothing happens. No dialog box...
The dll is generated through project wizard in VC2003. In that sense MYDLL_API is standard:
#define MYDLL_API __declspec(dllexport)
I am exporting a class through a dll, which is then invoked via an application.
The class is abstract, but then concrete implementations are provided through derived classes. One of the...
March 26th, 2008, 03:28 PM
But then how can I combine them to get something like:
class CMatrix< T >
private int _m;
private int _n;
private double[,] _data;
March 26th, 2008, 02:48 PM
While C# appeared similar to C++ on paper, I have started to struggle learning it. I started off with creating a generic matrix class, but soon simplified the problem to a class doing binary...
February 27th, 2008, 12:54 PM
What about token pasting?
February 27th, 2008, 11:24 AM
How can I use token pasting preprocessor directive? I need to call the right function given the function names in the form of an array.
#define CallMyFun( p, n ) p->##n ();
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.