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

Search:

Type: Posts; User: laserlight

Page 1 of 80 1 2 3 4

Search: Search took 0.50 seconds.

  1. Re: memory alloc, access and release by 3 different functions

    You should be more specific and tell us what is the error message. For example, it is possible that you have a numerical overflow problem, e.g., the minimum guaranteed range of short is [-32767,...
  2. Re: Bug in code of Longest Increasing Subsequence problem

    Suppose I wanted to help debug your code. I would try the test input patterns, going through the code step by step to see what went right or wrong. But all you said is that "for some it's giving...
  3. Replies
    1
    Views
    208

    Re: Cannot run this python program.

    Run it under Python 2.7 instead because it is not written for Python 3. In this case, print in Python 3 is a function, so if written for Python 3 it would have been:

    print('### Path Type: short...
  4. Replies
    1
    Views
    171

    Re: friend function

    SecondClass already has a function named getBox1 that returns a FirstClass object, so you don't need the non-member version of getBox1 to be a friend function. Actually, you don't need at the...
  5. Replies
    5
    Views
    334

    Re: Crash on vector::back()

    You can compile and run this program to convince yourself that if there is an error, it lies elsewhere:

    #include <iostream>
    #include <vector>
    #include <string>

    int main()
    {
    auto...
  6. Re: Need help on Priority Queue Implementations

    What do you mean by "interactive mode"?

    Anyway, take a look at the std::priority_queue adapter for an example of what a priority queue interface might be like. To implement with an ordered array...
  7. Re: How to avoid an empty entry when an empty slot is found?

    Although it is quite clear that the use of operator[] here is a bug since adding a new entry when currentWindow is not found is undesirable, I don't think switching to use at() is necessarily the...
  8. Re: Why B::Awake is not called on A's constructor?

    Refer to the answer to this FAQ: When my base class’s constructor calls a virtual function on its this object, why doesn’t my derived class’s override of that virtual function get invoked?

    ...
  9. Replies
    5
    Views
    478

    Re: passing on a variable at runtime

    This sounds like something for a configuration file.

    Anyway, "this input is very important ..it has to be passed to almost all the other functions in the other .cpp files in the project" makes it...
  10. Replies
    20
    Views
    614

    Re: eof not working properly?

    Comma Separated Value format
  11. Replies
    20
    Views
    614

    Re: eof not working properly?

    Sorry, I missed that. Anyway, the braces form the syntax for the C++11 uniform initialisation.


    However, note that 2kaud's suggestion actually ignores lines altogether: if this is undesirable,...
  12. Replies
    20
    Views
    614

    Re: eof not working properly?

    Oh, if there is indeed a blank line at the end in the input, then of course just checking the return value of getline will not suffice. However, this points to another problem: you rely on std::stoi...
  13. Replies
    20
    Views
    614

    Re: eof not working properly?

    You understood correctly: the problem is that the EOF flag is only set when end of file is reached (or there is an error, but that is presumably not the case here). But end of file is only reached...
  14. Replies
    1
    Views
    266

    Re: class type macro

    Why do you want to do this? In your example, you can simply write foo, so I presume that you have a more sophisticated example in mind that illustrates why this would be useful to you.
  15. Re: Debug Error? Code runs fine in web based compilers but not in VS alphabet pyramid

    You need to understand the problem (I explained it at the very end of my post), not just guess a solution.

    I have not verified what GCDEF observed, but you should investigate that too.
  16. Replies
    20
    Views
    1,045

    Re: Sparse Matrix Operations

    euclid2016: err... that would entirely uncalled for. By asking that question, VictorN presumably intended to establish that you do know an algorithm for computing addition(A+B). If you did not know...
  17. Re: Debug Error? Code runs fine in web based compilers but not in VS alphabet pyramid

    It sounds like it compiled, but you got a checked iterator error at run time? I don't have Visual Studio installed, and compiling with g++ 4.8.4 with -D_GLIBCXX_DEBUG to enable checked iterators did...
  18. Thread: Classes

    by laserlight
    Replies
    18
    Views
    1,221

    Re: Classes

    Because you declared it to be public, the array from class A is already available in a class B member function context, e.g.,

    #include <iostream>

    using namespace std;

    class A
    {
    public:
    ...
  19. Thread: Classes

    by laserlight
    Replies
    18
    Views
    1,221

    Re: Classes

    You need an object of class A to call a non-static member function of class A.
  20. Replies
    1
    Views
    533

    Re: Pointer by reference problem

    I don't see how that is a problem: both m_d pointers in the B and C objects point to the same D object. Your problem is that you did not create this D object, and then you made a type mistake, i.e.,...
  21. Replies
    6
    Views
    473

    Re: Main () Question

    Yes, they don't. In this case, it is data_out that calls them.
  22. Replies
    6
    Views
    473

    Re: Main () Question

    Notice that you call suma and sumb in data_out. Your calls of suma and sumb in main actually have no net effect: they make a computation and return a value, but the return value is unused in main. A...
  23. Re: How to make a short form of copy constructor in the inherited class?

    Perhaps you should break A up into smaller classes that models one thing and models it well?
  24. Replies
    7
    Views
    473

    Re: Reusing the code

    Agreed, but if you are bothering with operator overloading, then it stands to reason that you might regard the syntactic sugar of the operator invocation form more beautiful compared to the ordinary...
  25. Replies
    7
    Views
    473

    Re: Reusing the code

    Yes. Compare with part of a typical implementation of postfix operator++ using prefix operator++:

    ++*this;
Results 1 to 25 of 2000
Page 1 of 80 1 2 3 4


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


HTML5 Development Center