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.24 seconds.

  1. Re: What is the common technique of using pointers to change some value on the fly?

    The first problem is that you're printing a pointer, not an A or B object. Furthermore, the object that a points to is of class A, not B, so you cannot just cast from A* to B* (whereas casting from...
  2. Replies
    19
    Views
    863

    Re: Dear Expert Help me out

    If you're trying to create your own scheme for license keys (or whatever it is), then perhaps you should be searching the existing literature and reading freely available code that already does...
  3. Re: How to make a std::map return null when there is nothing "at" a certain position?

    Yeah, that's why I suggested using find instead of operator[]. On closer inspection though, lucky6969b's default value is 0, and since value initialisation of an integer type would result in zero...
  4. Re: How to make a std::map return null when there is nothing "at" a certain position?

    Make use of the find member function instead of operator[]. This way, when find returns an iterator equal to unitColors.end(), you know that you should use your default value instead.
  5. Replies
    19
    Views
    863

    Re: Dear Expert Help me out

    Refer to the Acceptable Use Policy:



    Are you trying to create your own license key (or some challenge response, whatever) system?
  6. Re: error: expected constructor, destructor, or type conversion before (

    This has been answered elsewhere. Next time, I suggest that you post on a single help channel at a time, and if and when you move to a different help channel, inform.
  7. Replies
    19
    Views
    863

    Re: Dear Expert Help me out

    Sorry, but this is probably against the forum rules/acceptable use policy, so even if we had enough information to help you, it would not be wise to do so.
  8. [RESOLVED] Broken link for Acceptable Use Policy

    In the list of topics, e.g., for this Feedback forum, there is a special announcement thread titled "Before you post...." that links to an AUP under the "Inappropriate Posts" paragraph....
  9. Replies
    19
    Views
    863

    Re: Dear Expert Help me out

    Wait, what are these challenge and response codes for? Why do you "lose so much money" when you "have to use token"?
  10. Replies
    7
    Views
    335

    Re: need help in simple program logic

    It is implementation defined as to whether char is signed or unsigned. If char is unsigned, then CHAR_MAX would be equivalent to UCHAR_MAX, which is guaranteed to be at least 255, so your program is...
  11. Replies
    7
    Views
    278

    Re: accessing nested elements...

    Ah. It would have then been clearer if you asked how to iterate over the inner elements of a std::set<vector<int>> using range-based for loops.
  12. Replies
    19
    Views
    863

    Re: Dear Expert Help me out

    If we consider Kerckhoffs's principle then it is not true that "the whole purpose is that you should not be able to find out (the algorithm)": for a secure cryptosystem, the algorithm could be...
  13. Replies
    17
    Views
    1,089

    Re: Sorted vector/list to set

    Ah, once you explained that you're thinking of how the binary search to find the insertion point is similiar to how set operations will find the insertion point, I do see the analogy.


    Nah, I...
  14. Replies
    7
    Views
    278

    Re: accessing nested elements...

    I did that, i.e., I suggested that you attempt with the simple containers first. What I did not do was to provide a code sample, but that was because I expected that my suggestions should be...
  15. Replies
    7
    Views
    278

    Re: accessing nested elements...

    Suppose you have a std::set<int>. How would you access the first int in the set? You would do something similiar when the set contains vectors.

    Now, suppose you have a vector. How would you access...
  16. Re: Return a list of defines given a range.

    The problem is that preprocessing directives are executed at an earlier phase in translation. As such, by the time we start talking about containers and other data structures, they no longer exist,...
  17. Replies
    17
    Views
    1,089

    Re: Sorted vector/list to set

    The thing is, insertion sort is well known for having O(n^2) time complexity, whereas similiar insertions to a std::set results in O(n log n) time complexity, so the behavioural and runtime...
  18. Replies
    17
    Views
    1,089

    Re: Sorted vector/list to set

    That does not make sense to me though: wouldn't that just use the ordinary balanced binary tree operations rather than an insertion sort? Or are you referring to "insertion sort" in the more general...
  19. Re: Overloading addition and comparing expressions in a while loop

    It looks like you are trying to overload operator+ when you should be overloading operator+= instead:

    Sales_data& Sales_data::operator+=(const Sales_data& other) {
    if (bookNo != other.bookNo)...
  20. Replies
    38
    Views
    1,265

    Re: error: expression must have a class type

    Yes, that would be a correct way of describing it. I probably meant "comparisons" instead.


    You forgot to use braces for the inner loop body, therefore the scope of j does not extend to that...
  21. Replies
    38
    Views
    1,265

    Re: error: expression must have a class type

    The comparison should be quite simple: at the core of bubble sort is the comparison of adjacent elements, and that comparison does precisely that.

    The loop condition might be a little harder to...
  22. Replies
    38
    Views
    1,265

    Re: error: expression must have a class type

    Exactly. Notice that the two examples are effectively the same: other than in the first line, every instance of the name arrCopy from example 1 has been substituted with arrOrg in example 2, and...
  23. Replies
    38
    Views
    1,265

    Re: error: expression must have a class type

    Actually, I'd say 2kaud is "wrong" as the two possible ways listed are actually just one way:

    If you copy the original array and sort the copy, then you need to re-copy the original array before...
  24. Replies
    38
    Views
    1,265

    Re: error: expression must have a class type

    Well, you need to understand:

    The notion of scope and local variables.
    The notion that formal parameters are local variables, and that parameter names need not match the names of the actual...
  25. Replies
    38
    Views
    1,265

    Re: error: expression must have a class type

    Actually, 2kaud wrote that in post #19. It is a repeat of what I wrote in post #18, i.e., you passed arr as the argument to selectionSort instead of passing arrCopy, and consequently arrCopy remained...
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 is a CodeGuru survey question.


Featured


HTML5 Development Center