Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C# Question: static int amountopen = (0 - 500); ???

C# Question: static int amountopen = (0 - 500); ???

Scheduled Pinned Locked Moved C#
questioncsharplearning
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chua Wen Ching
    wrote on last edited by
    #1

    Hi there, I had some questions. I was learning c# and i saw this code: static int amountopen = (0 - 500); Hmm.. wonder, does it means we are setting a scope from 0 to 500 for integer amountopen? This is first time i seen. Oh ya, another added question. How does virtual keyword comes in handy in c# programming? Any good samples and explanations on that please. Thanks. Regards, Chua Wen Ching :p

    A 1 Reply Last reply
    0
    • C Chua Wen Ching

      Hi there, I had some questions. I was learning c# and i saw this code: static int amountopen = (0 - 500); Hmm.. wonder, does it means we are setting a scope from 0 to 500 for integer amountopen? This is first time i seen. Oh ya, another added question. How does virtual keyword comes in handy in c# programming? Any good samples and explanations on that please. Thanks. Regards, Chua Wen Ching :p

      A Offline
      A Offline
      Alvaro Mendez
      wrote on last edited by
      #2

      chuawenching wrote: static int amountopen = (0 - 500); Hmm.. wonder, does it means we are setting a scope from 0 to 500 for integer amountopen? Nope, it just means make amountopen = to the result of subtracting 500 from 0. :-) chuawenching wrote: How does virtual keyword comes in handy in c# programming? Any good samples and explanations on that please. Here's a link that should help: http://www.jaggersoft.com/csharp_course/16_Inheritance_files/frame.htm[^] Click on "virtual Methods". Regards, Alvaro


      Hey! It compiles! Ship it.

      C 1 Reply Last reply
      0
      • A Alvaro Mendez

        chuawenching wrote: static int amountopen = (0 - 500); Hmm.. wonder, does it means we are setting a scope from 0 to 500 for integer amountopen? Nope, it just means make amountopen = to the result of subtracting 500 from 0. :-) chuawenching wrote: How does virtual keyword comes in handy in c# programming? Any good samples and explanations on that please. Here's a link that should help: http://www.jaggersoft.com/csharp_course/16_Inheritance_files/frame.htm[^] Click on "virtual Methods". Regards, Alvaro


        Hey! It compiles! Ship it.

        C Offline
        C Offline
        Chua Wen Ching
        wrote on last edited by
        #3

        Thanks for the reply. amountopen = to the result of subtracting 500 from 0. --> subtract 500 from 0 means amountopen = -500 ??? So why can't the coder code this: amountopen = -500 rather than amountopen = (0-500) What is his purpose? Thanks for the virtual link? Is that the best site to learn oop way in c#? Must the slides does not show a complete source code. I want to learn while coding? Thanks. :) Regards, Chua Wen Ching :p

        A 1 Reply Last reply
        0
        • C Chua Wen Ching

          Thanks for the reply. amountopen = to the result of subtracting 500 from 0. --> subtract 500 from 0 means amountopen = -500 ??? So why can't the coder code this: amountopen = -500 rather than amountopen = (0-500) What is his purpose? Thanks for the virtual link? Is that the best site to learn oop way in c#? Must the slides does not show a complete source code. I want to learn while coding? Thanks. :) Regards, Chua Wen Ching :p

          A Offline
          A Offline
          Alvaro Mendez
          wrote on last edited by
          #4

          chuawenching wrote: So why can't the coder code this: amountopen = -500 rather than amountopen = (0-500) I don't know. If you can ask him/her, hopefully you can find out. There's no obvious answer, except perhaps the developer didn't know he/she could just write -500. :~ chuawenching wrote: Is that the best site to learn oop way in c#? Must the slides does not show a complete source code. I want to learn while coding? It's the best one I could come up with on short notice. I'm sure there are others out there that do a better job. Here's one from MSDN which may serve you better: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcoriCProgrammersReference.asp[^]. Depending on how much previous experience you have with other languages, a book on C# programming may also help. Good luck! Alvaro


          Hey! It compiles! Ship it.

          C 1 Reply Last reply
          0
          • A Alvaro Mendez

            chuawenching wrote: So why can't the coder code this: amountopen = -500 rather than amountopen = (0-500) I don't know. If you can ask him/her, hopefully you can find out. There's no obvious answer, except perhaps the developer didn't know he/she could just write -500. :~ chuawenching wrote: Is that the best site to learn oop way in c#? Must the slides does not show a complete source code. I want to learn while coding? It's the best one I could come up with on short notice. I'm sure there are others out there that do a better job. Here's one from MSDN which may serve you better: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/csref/html/vcoriCProgrammersReference.asp[^]. Depending on how much previous experience you have with other languages, a book on C# programming may also help. Good luck! Alvaro


            Hey! It compiles! Ship it.

            C Offline
            C Offline
            Chua Wen Ching
            wrote on last edited by
            #5

            Thanks :) But i feel that msdn tutorials a bit complicated. So many links here and there. And at the end i learn nothing. :( Regards, Chua Wen Ching :p

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups