C# Question: static int amountopen = (0 - 500); ???
-
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
-
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
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.
-
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.
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
-
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
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.
-
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.
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