CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: angelorohit

Page 1 of 15 1 2 3 4

Search: Search took 0.10 seconds.

  1. Re: Overloading the = Operator for a Class

    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.

    Also,...
  2. Replies
    5
    Views
    819

    Poll: Re: Preference question about libraries

    I tend to use forward declarations if it would suffice. The reasons are exactly the same as what Lindley mentioned.
  3. Replies
    7
    Views
    842

    Re: reading file question

    You could use string streams. Do read this for more info: Stream Thy Strings
    Hope this helps.
  4. Replies
    9
    Views
    2,190

    Re: Parse C++ function

    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?
  5. Replies
    9
    Views
    2,190

    Re: Parse C++ function

    I'm not quite sure if I understand what you mean... Could you elaborate?
  6. Replies
    24
    Views
    2,187

    Re: Little help

    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);
    int sortArray(int...
  7. Replies
    5
    Views
    860

    Re: String manipulation

    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!

    IMHO, at...
  8. Replies
    7
    Views
    1,086

    Re: PLease explain this syntax

    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...
  9. Replies
    8
    Views
    1,244

    Re: [not a problem] Just a little humor..

    I believe its called Hexspeak. http://en.wikipedia.org/wiki/Hexspeak
    :)
  10. Replies
    2
    Views
    3,720

    Re: setting up a simple template...

    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>
    void...
  11. Re: Linked List Stack Pop() problem

    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...
  12. Re: reading to unsigned int from text file in c? please help

    I think you might find this article useful.
    http://www.artima.com/cppsource/streamstrings.html
  13. Replies
    2
    Views
    587

    Re: Problem with input/output

    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...
  14. Thread: i++ vs ++i

    by angelorohit
    Replies
    6
    Views
    1,499

    Re: i++ vs ++i

    As a good rule of thumb, I always prefer prefix to postfix in C++.
    http://www.parashift.com/c++-faq-lite/operator-overloading.html#faq-13.15
  15. Replies
    4
    Views
    730

    Re: Class inheritance issues

    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...
  16. Replies
    19
    Views
    2,031

    Re: New Help with a problem

    Umm... The limit for the inner loop should be N/2, not sqrt(N) since we are trying to find factors, not prime numbers.
  17. Replies
    19
    Views
    2,031

    Re: New Help with a problem

    Did you use recursion? If not, could you PM me your code, I'm curious to see your solution. :)
  18. Replies
    9
    Views
    1,310

    Re: Function and char problem

    You could try:


    std::cin >> litres;
    std::cin.ignore(std::numeric_limits<std::streamsize>::max(), ':');
    std::cin >> miles;

    This will ignore all the characters upto the maximum size of the...
  19. Re: Why Scott Meyers wants you to slap yourself?

    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++.
  20. Re: Why Scott Meyers wants you to slap yourself?

    You've met Scott Meyers? That's amazing! I wish I could meet Scott Meyers someday (and Herb Sutter ofc). :)
  21. Replies
    7
    Views
    897

    Re: passing function

    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.
  22. Replies
    13
    Views
    4,700

    Re: Infinite loop in c++...

    "clear" on Unix or Linux is the equivalent of "cls" on DOS.
  23. Re: Working in DOS. How to Launch another App?

    Well, that's obviously because the exe could not be found. Are you sure you set the path properly?
  24. Replies
    3
    Views
    930

    Re: Iterator Question

    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...
  25. Re: Working in DOS. How to Launch another App?

    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...
Results 1 to 25 of 351
Page 1 of 15 1 2 3 4





Click Here to Expand Forum to Full Width

Featured