Search:
Type: Posts; User: HighCommander4
Search:
Search took 0.10 seconds.
-
July 26th, 2011, 01:49 PM
That depends on whether or not the OP needs the entries of mIndex to be processed in the order they appear in mIndex. If not, then yes, this would be even faster.
-
July 26th, 2011, 01:46 AM
The same reason C++ arrays aren't like Java arrays: we want to avoid extra allocations when not necessary.
-
July 25th, 2011, 09:35 PM
You are reading the file over and over again for each index. There is no need to do that.
My suggestion would be:
1) Read the file once, and store it in memory in a map<string, string>, where...
-
July 25th, 2011, 03:25 PM
For what it's worth, the C++0x standard specifies fine-grained requirements for each of the STL container member functions rather than imposing requirements on the container as a whole. In...
-
June 13th, 2011, 03:46 AM
If you need to do the capture in code, you should look at the WinPCAP library and its C# wrapper, PCAP.NET.
(p.s. HighCommander4 is sad because he liked his post count being 1337 :D).
-
January 16th, 2011, 07:49 PM
Hello, it's nice to be back :wave:
I have a distributed system consisting of many processes, and I am designing a mechanism by which they can all send messages to a "monitor" process.
Each...
-
October 16th, 2010, 12:34 AM
I know it is only necessary to declare a method as virtual in the base class, and the overridden version in the derived class will automatically be virtual.
Does this apply to destructors as well?...
-
September 28th, 2010, 11:21 AM
The first makes no difference.
The second gives the error "invalid use of 'this' at top level".
Perhaps it's just my compiler that doesn't support this feature fully? I am using g++ 4.4.
-
September 27th, 2010, 08:52 PM
Consider the following code:
template <typename T>
class really_long_complicated_typename
{
public:
really_long_complicated_typename(T& x) : x(x) {}
private:
T& x;
-
September 15th, 2010, 10:40 AM
Really? In my experience, the compiler can still auto-generate a copy constructor, since references can be copy-constructed. It is only the assignment operator that the compiler cannot generate.
...
-
September 15th, 2010, 10:25 AM
From the Wikipedia page of C++0x:
So it's not that bad.
And as far as I'm aware, the C++0x committee goes out of its way not to break existing code.
-
September 15th, 2010, 12:51 AM
I'm not a VS user, but a quick google search reveals that it's under Edit->Advanced->Format Document.
-
September 14th, 2010, 09:23 PM
I'm assuming you also want it to print out the stuff in the function 'heading'.
To do this, you need to call 'heading' from 'main'. The code you wrote so far only defines the function 'heading',...
-
September 14th, 2010, 08:23 PM
You'll have to be a little more specific...
What do you expect it to do? What does it do right now?
-
September 14th, 2010, 08:21 PM
What are you looking to beautify? If it's C++ code, then most IDEs (e.g. eclipse, Visual Studio) have a "Format" feature that formats the code according to conventions that you can (usually)...
-
September 14th, 2010, 03:55 PM
Or you could use the standard library function nearbyint().
-
September 13th, 2010, 10:17 PM
Don't beat yourself up :) *nix internals are tricky (well, all OS internals are...)
-
September 13th, 2010, 10:04 PM
I never said the file descriptors were the same... The man page I quoted says that one is a copy of the other. On the other hand, they point to the same file description - the file description is not...
-
September 13th, 2010, 08:45 PM
Nope. There is a subtle difference between file descriptors and file descriptions. A file description is data structure in the kernel which stores information about an open file such as the current...
-
September 13th, 2010, 04:21 PM
From the man page for fork:
I'm no expert, but I think this effectively means that it is safe for either the child or the parent to use the file/socket, but not both (the one that doesn't use...
-
September 13th, 2010, 03:55 PM
Note that you can get your original version to work if you provide the enumeration name in the function declaration (SOME_PARENT::MyEnum instead of SOME_PARENT::SOME_ENUM) and you provide the...
-
September 13th, 2010, 01:13 PM
Very true, but I'm sure you meant to declare p as some class type rather than int... ;)
-
September 13th, 2010, 10:18 AM
I will, gladly. :D
I use Eclipse CDT with gcc. Besides both of them (eclipse and gcc) being cross-platform, Eclipse CDT has an internal parser which parses your code on the fly and applies syntax...
-
September 7th, 2010, 11:52 AM
Interesting, I didn't know about std:: ptr_fun.
However, since it only transforms pointers to functions into functors (as opposed to anything function-like into a functor), it must still be used...
-
September 7th, 2010, 11:13 AM
I don't know much about how compilers work, but would it make writing compilers much more difficult, or would it make them much slower (because they would have to do more passes) if they were...
|
Click Here to Expand Forum to Full Width
|