Search:

Type: Posts; User: -EquinoX-

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Replies
    17
    Views
    2,846

    okay... some say that using operator cast will...

    okay... some say that using operator cast will allow me to use one function definition
  2. Replies
    17
    Views
    2,846

    that's what my original question is, would it be...

    that's what my original question is, would it be possible just to use one function definition to cover both (String, int) and (int, String) in overloading?
  3. Replies
    17
    Views
    2,846

    here is my operator* String operator*(int n,...

    here is my operator*


    String operator*(int n, const String& str){
    String r;
    if (n > 0){
    for (int i = 0; i < n; i++)
    r = str + str;
    }
    else if (n < 0)
  4. Replies
    17
    Views
    2,846

    okay lets get back to my first topic, when I just...

    okay lets get back to my first topic, when I just use that one... I get:

    error: invalid conversion from âintâ to âconst char*â
    error: initializing argument 1 of âString::String(const char*)â...
  5. Replies
    17
    Views
    2,846

    I see that explains, also another question about...

    I see that explains, also another question about overloading unary operator.. I have the following:


    String String::operator-(){
    String r('x', strlen(itsPtr) + 1);
    int j = 0;
    for(int i =...
  6. Replies
    17
    Views
    2,846

    May I know the reason why?

    May I know the reason why?
  7. Replies
    17
    Views
    2,846

    overloading operator in C++

    If say I want to overload the following:


    String operator*(const String& str, int n);


    and my test case is:


    String ab = ab0 * 3;
  8. Replies
    11
    Views
    1,436

    Dae mention the term "subject", what is he...

    Dae mention the term "subject", what is he actually referring to?
  9. Replies
    11
    Views
    1,436

    so putting a const in that function parameter...

    so putting a const in that function parameter will make the bug apparent because the compiler will fail?
  10. Replies
    11
    Views
    1,436

    so are you saying that by putting a const in the...

    so are you saying that by putting a const in the function parameter gives an indication that the print shouldn't change the subject?
  11. Replies
    11
    Views
    1,436

    Could you give me more details why making the...

    Could you give me more details why making the second argument a const reference would make it work?
  12. Replies
    11
    Views
    1,436

    making a bug apparent

    My instructor said that if the writer of the code below made full use a language feature in C++ from one of the following:

    References
    The const qualifier
    NULL vs. 0
    bool
    The friend specifier...
  13. Replies
    8
    Views
    3,973

    basically what I want to do is the following: ...

    basically what I want to do is the following:

    example:

    52 to result in

    00110100

    not
  14. Replies
    8
    Views
    3,973

    Operations are +, - and * and bit shifting.. I...

    Operations are +, - and * and bit shifting.. I guess the bit shifting would be easy as it is just shifting elements/bits in the vector... my only problem right now is how to convert those very long...
  15. Replies
    8
    Views
    3,973

    I need to implement my own using a vector, and...

    I need to implement my own using a vector, and then store digits.... is there any implementation out there that does this?
  16. Replies
    8
    Views
    3,973

    integer to two's complement

    what if I want to represent a huge number such as 2^100 to a two's complement, an int definitely can't handle this....
  17. Replies
    13
    Views
    5,048

    shifting array elements... basically

    shifting array elements... basically
  18. Replies
    13
    Views
    5,048

    should it be something like: obj operator

    should it be something like:

    obj operator<< (const obj& b1, const int b2)
  19. Replies
    13
    Views
    5,048

    overloading bit shift

    when overloading a bit shift in c++, does it actually take one arguments or two?? how does the function looks like?
  20. Replies
    8
    Views
    1,282

    so it should take two arguments you mean?

    so it should take two arguments you mean?
  21. Replies
    8
    Views
    1,282

    how about this one: type& operator~=(); ...

    how about this one:



    type& operator~=();


    I get this error:

    :35: error: expected primary-expression before â)â token
  22. Replies
    8
    Views
    1,282

    and does it return a test& or a test? a reference...

    and does it return a test& or a test? a reference or a value?
  23. Replies
    8
    Views
    1,282

    overloading not

    why when I try to compile this



    test& operator~ (const test& b1, const test& b2);


    I get:

    error: âtest& Htest::operator~(const test&, const test&)â must take âvoidâ
  24. Replies
    9
    Views
    1,473

    and how do I fix undefined reference errors: ...

    and how do I fix undefined reference errors:

    undefined reference to `Simulator<25, 25>::Simulator(Vehicle*)'
    undefined reference to `Simulator<25, 25>::~Simulator()'
  25. Replies
    9
    Views
    1,473

    thanks

    thanks
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4