View minimum int with int.MinValue()?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: View minimum int with int.MinValue()?

  1. #1
    Join Date
    Feb 2010
    Posts
    13

    Question View minimum int with int.MinValue()?

    Hello,

    I am trying to store and view the minimum int number. I have understood that I should use int.MinValue but this code gives the error:

    "Non-invocable member "int.MinValue"cannot be used like at method "

    Code:
                int a;
                a = int.MinValue();
                Console.Write("The minimum int value is {0}, a");
    I have also tried with int32.MinValue()

  2. #2
    Join Date
    Oct 2008
    Location
    Cologne, Germany
    Posts
    756

    Re: View minimum int with int.MinValue()?

    MinValue is a property not a method so remove the parentheses and read the documentation more carefully, the a must not be a part of the string, it's a variable and if you want to dispalay its value you must use it as a parameter

    PHP Code:
    int a int.MinValue;
    Console.Write("The minimum int value is {0}"a); 
    win7 x86, VS 2008 & 2010, C++/CLI, C#, .NET 3.5 & 4.0, VB.NET, VBA... WPF is comming

    remeber to give feedback you think my response deserves recognition? perhaps you may want to click the Rate this post link/button and add to my reputation

    private lessons are not an option so please don't ask for help in private, I won't replay

    if you use Opera and you'd like to have the tab-button functionality for the texteditor take a look at my Opera Tab-UserScirpt; and if you know how to stop firefox from jumping to the next control when you hit tab let me know

  3. #3
    Join Date
    Feb 2010
    Posts
    13

    Re: View minimum int with int.MinValue()?

    I see, thank you for the answer. I am new to this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center