About 9,600,000 results
Open links in new tab
  1. In C# what is the difference between myInt++ and ++myInt?

    Jan 13, 2009 · In the first case, myInt is incremented and the new/incremented value is passed to MyFunction (). In the second case, the old value of myInt is passed to MyFunction () (but myInt is still …

  2. What is the difference between "int myInt;" and "int myInt = 0;"

    However it is best practice to initialize a value on a field so the most equivalent of the three options you listed is the third one: int myInt = 0 You cannot assign a struct (value type) to null as it is a non …

  3. Correct place to initialize class variables? - Stack Overflow

    Where is the correct place to initialize a class data member? I have the class declaration in a header file like this: Foo.h: class Foo { private: int myInt; }; Then I try to set a value to m...

  4. Turning a double to an int in Java - Stack Overflow

    Apr 29, 2014 · 6 The assignment double myDouble = 4 contains a "primitive widening conversion", which takes the int literal 4 and widens it to a double, specifically, 4.0. Java usually doesn't allow …

  5. java - Comparable interface project - Stack Overflow

    Feb 26, 2016 · Comparing rhs to itself (by aliasing it to myInt) should always return 0. And storing the result as a temporary variable doesn't seem to server any purpose in your code.

  6. Python- %s %f %d % etc - Stack Overflow

    Jan 28, 2019 · Just a heads up, don't use this notation. .format() and f-strings are preferred in Python 3.

  7. Overriding fields or properties in subclasses - Stack Overflow

    abstract class Father { abstract public int MyInt { get; set;} } class Son : Father { public override int MyInt { get { return 1; } set { } } } Option 2 I can declare a public field (or a protected field) and explicitly …

  8. C# Static variables - scope and persistence - Stack Overflow

    I just did a little experiment: public abstract class MyClass { private static int myInt = 0; public static int Foo() { return myInt; } public static int Foo(int n) { myInt =...

  9. Convert a positive number to negative in C# - Stack Overflow

    May 9, 2017 · You can convert a negative number to positive like this: int myInt = System.Math.Abs(-5); Is there an equivalent method to make a positive number negative?

  10. While doing operator overloading on + and - Stack Overflow

    Mar 27, 2014 · Your line numbers in codepad don't match up with the errors you posted. myint.cpp:193 (line 171): In MyInt operator+ (const MyInt& x, const MyInt& y), you call x.Grow();, however x is …