Type: Posts; User: angelorohit
Search took 0.03 seconds.
September 13th, 2011, 09:57 PM
There's no hard and fast rule. You can write:
void exclass::operator =(const differentclass& right_hand_side);
However, as Lindley mentioned, there has to be a reason for doing so.
September 12th, 2011, 08:52 PM
I tend to use forward declarations if it would suffice. The reasons are exactly the same as what Lindley mentioned.
September 11th, 2011, 08:44 PM
You could use string streams. Do read this for more info: Stream Thy Strings
Hope this helps.
September 9th, 2011, 09:54 AM
Yes, I'm aware of what a function prototype means. However, what do you mean by parsing? Are you talking about identifying all function prototypes in a source file?
September 9th, 2011, 09:45 AM
I'm not quite sure if I understand what you mean... Could you elaborate?
September 9th, 2011, 01:50 AM
Your function declarations are not compatible with their definitions. Your declarations should be:
int randArray(int array, int size);
int dispArray(int array, int size);
September 8th, 2011, 04:57 AM
If I understand this correctly, your professor wants you to evaluate an infix expression. He may at any point in time ask you to do the same for a prefix or postfix notation. Be prepared!
September 6th, 2011, 01:41 AM
Correct me if I'm wrong, but I think the second one is an overload of the function call operator that returns the sum of the argument and the data member as an int. So, you could do something like...
February 15th, 2010, 12:29 AM
I believe its called Hexspeak. http://en.wikipedia.org/wiki/Hexspeak
September 12th, 2009, 02:56 AM
Ah, the discrepancies between compilers! Microsoft's compiler would happily compile your code but gcc is more conforming to the standard. The Fix:
template <typename Container>
September 12th, 2009, 01:15 AM
You are returning prematurely from the function. When the return statement is encountered, the program will exit the function and the rest of the statements will never be executed. This means that...
September 5th, 2009, 01:45 PM
I think you might find this article useful.
September 5th, 2009, 12:54 PM
With cin, a white space is a delimiter. So, what's happening here is that data is being grabbed from the input stream until a space is encountered. After the first cin, the variable name will contain...
September 5th, 2009, 12:34 PM
As a good rule of thumb, I always prefer prefix to postfix in C++.
As others have pointed out, you have created a Diamond of Death.
Getting past that, I still don't understand why you might expect b->getcarcolor() to return redcar-red? Since, you have cast...
November 4th, 2008, 12:26 AM
Umm... The limit for the inner loop should be N/2, not sqrt(N) since we are trying to find factors, not prime numbers.
November 3rd, 2008, 11:51 PM
Did you use recursion? If not, could you PM me your code, I'm curious to see your solution. :)
November 3rd, 2008, 10:34 PM
You could try:
std::cin >> litres;
std::cin >> miles;
This will ignore all the characters upto the maximum size of the...
October 23rd, 2008, 11:10 PM
Yes, I've always believed that for a developer to truly say he knows C++, he should have read and understood Effective C++, More Effective C++, Exceptional C++ and More Exceptional C++.
October 23rd, 2008, 10:59 PM
You've met Scott Meyers? That's amazing! I wish I could meet Scott Meyers someday (and Herb Sutter ofc). :)
October 23rd, 2008, 10:19 AM
I believe that you just need to include "boost/function.hpp" to use it. You should be able to find this file in the boost folder of your installation.
October 22nd, 2008, 11:37 PM
"clear" on Unix or Linux is the equivalent of "cls" on DOS.
October 22nd, 2008, 07:26 AM
Well, that's obviously because the exe could not be found. Are you sure you set the path properly?
October 22nd, 2008, 04:17 AM
Btw, your code has a memory leak. You do a new in the getKeyValue() function and never do a delete on the pointer that's returned.
I'd suggest not returning by reference at all, instead return by...
October 22nd, 2008, 02:30 AM
You may not know the absolute path but you must know the relative path. For example, if lwhiz.exe is right next to myapp.exe, then your relative path is simply "lwhiz.exe". If your directory...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.