Type: Posts; User: D_Drmmr
Search took 0.09 seconds.
You can write a function to find the highest 2 values in a series of values by keeping track of the highest and second highest while iterating over all values.
However, since you already know the...
Unless they are defined as static global variables in different compilation units. The keyword static has a different meaning when applied to global variables, than when applied to class/local...
March 4th, 2014, 06:59 AM
Never put a using declaration at global scope in a header file. Every file that includes this header will get that using declaration, which can cause name conflicts.
IMO, it's way easier to learn to...
March 4th, 2014, 06:09 AM
You could write a VBA macro to read the xml file and copy the text in it to the right places.
February 18th, 2014, 09:23 AM
AFAIK, that's not a valid string literal, because it doesn't consist of ASCII characters. You should read up on Unicode encodings.
You should use the Unicode setting unless you want to support...
February 17th, 2014, 01:25 PM
Is it possible to pass this as an argument to the function object?
February 16th, 2014, 10:50 AM
Instead of complaining about others, why don't you have a good look at yourself first? You were able to solve the problem yourself (or at least, without help from anyone here) in 2 hours. Yet you did...
February 10th, 2014, 04:20 AM
What did you think the curve should look like with those control points?
February 8th, 2014, 06:42 AM
That's because you have syntax errors. What is the first error message that the compiler gives you? What's the corresponding line in your code? What is it about the error message that you don't...
February 6th, 2014, 02:57 AM
AFAIK, it's Microsoft specific. strncpy is standard.
February 5th, 2014, 01:37 AM
1. Please use code tags. Your code is unreadable without them.
2. Does the code you posted actually replicate the problem?
3. You are using uninitialized variables. j is never assigned a value....
January 27th, 2014, 05:40 AM
Then either you need to change the project specs or you need to learn C++ if you want to achieve anything. You cannot bluff your way through C++. It is completely unlike the languages you mention,...
January 27th, 2014, 04:13 AM
You failed to mention what you can do. Do you program at all? If so, which language?
Last time I checked (more than a year ago), the boost library does not support regions for memory mapped files,...
January 26th, 2014, 03:06 AM
Have a look at http://etutorials.org/Programming/secure+programming/Chapter+12.+Anti-Tampering/
January 25th, 2014, 11:13 AM
You declared 'l' to be a pointer to a Line. That means you cannot write 'l.'. Pointers don't have members. The second argument of the foreach macro in Qt is the container you want to iterate over. I...
January 19th, 2014, 04:59 AM
Right, so there is no need for C-style casts.
Actually, since the function takes the 4th argument (std::string) by value, you don't need to make a local variable for it; you can pass a temporary...
January 18th, 2014, 04:14 PM
testType::test_Value is not a type, it's a member variable.
January 18th, 2014, 07:59 AM
So what did you think that this would achieve?
If s.animationName_ is a std::string and the function you are calling asks for a std::string& as a parameter, how...
January 17th, 2014, 08:47 AM
What is s.animationName_?
Why are you C-style casting to a std::string?
January 13th, 2014, 08:03 AM
You can write your inner loop as a function that is templated on the iterator type. Then call it like this
for( std::map<std::string,std::set<std::pair<std::string, double> > >::iterator it =...
January 13th, 2014, 07:21 AM
I did not say raw pointers are safer than smart pointers, quite the opposite. I said that blindly replacing the use of raw pointers with shared pointers can hide bugs in your program or make them...
January 13th, 2014, 03:51 AM
I would call it a bug, rather than "standard".
January 13th, 2014, 03:46 AM
Using raw pointers is not inherently bug-prone. Doing manual memory management is bug-prone and should be avoided whenever possible (e.g. using vector, unique_ptr and shared_ptr). However, simply...
January 12th, 2014, 08:13 AM
There can be two reasons to use a pointer instead of a reference:
1. A pointer can point to NULL (i.e. no object), whereas a reference must refer to a valid object. So you can use a pointer e.g. to...
January 8th, 2014, 04:30 AM
Here's another way
std::ifstream inf("file name");
Click Here to Expand Forum to Full Width