Search:

Type: Posts; User: igoogleu

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    5,630

    "data" is of a generic type which does not...

    "data" is of a generic type which does not support "==" operator in general.

    In you case, you can constrain T to of interface type "IComparable<T>", thus you do any comparison by using...
  2. Replies
    12
    Views
    2,193

    Thanks! That's what I did last night! I was...

    Thanks! That's what I did last night! I was thinking too much and forgot the simplest way. I don't need a reference to A.c if I just use property like that.
  3. Replies
    12
    Views
    2,193

    I don't know what was Mod doing? I posted it in...

    I don't know what was Mod doing? I posted it in C# section, and I am asking a C# question. Why move it to C++ section?
  4. Replies
    12
    Views
    2,193

    Currently I wrote a property "c" to return the...

    Currently I wrote a property "c" to return the value of .Count, but I have to add c= .Count everywhere .Count changes, right?
  5. Replies
    12
    Views
    2,193

    well, by "frequent" I mean I will manipulate A in...

    well, by "frequent" I mean I will manipulate A in many methods of B now and in the future. Thus each time I write a method manipulating A, I have to add a line "c=A.b". If there is a way I can write...
  6. Replies
    12
    Views
    2,193

    Hi salem, that makes sense. Actually, I don't...

    Hi salem, that makes sense. Actually, I don't want to change the value A.b outside A bypassing A's public property or methods. What I want is letting c be a read-only alias of A.b.


    public class...
  7. Replies
    12
    Views
    2,193

    How to refer an int type

    I have one class A which has an "int" field b; I defined another int type variable c. When I make any changes to A.b, I want c changes accordingly such that c=A.b .

    One can always add a line c=A.b...
  8. Replies
    7
    Views
    2,931

    I followed Daved and vart's suggestions to modify...

    I followed Daved and vart's suggestions to modify the get() function. Then it is ok.
    This forum is really quickly-replied and informed. Thanks all replies.
  9. Replies
    7
    Views
    2,931

    Sorry, the code is a little bit longer and the...

    Sorry, the code is a little bit longer and the varibles are not well named because the author wants to make the code short.
  10. Replies
    7
    Views
    2,931

    Thanks for replying. I tried add std:: , but I...

    Thanks for replying. I tried add std:: , but I still get some other errors. The code is posted here. I thought the main problem is with the istream class.



    The compile error is shown as the...
  11. Replies
    7
    Views
    2,931

    Problems with istream

    When I compile some old source code downloaded from Internet, I sometimes encounter the problems with

    #include <fstream.h>
    #include <iostream.h>

    The g++ compiler in cygwin claims the...
Results 1 to 11 of 13