Sign In | Subscribe
Start learning today, and be successful in your academic & professional career. Start Today!
Loading video...
This is a quick preview of the lesson. For full access, please Log In or Sign up.
For more information, please see full course syllabus of C#
  • Discussion

  • Study Guides

  • Table of Contents

Bookmark and Share
Lecture Comments (5)

0 answers

Post by Ehab Issa on August 3, 2015

Dear John,
the samples you gave regarding Nullable are wrong , for example
Console.Write(aVar.ToString()) ; You have not added the parentheses which why you always have an error , you can not use nullable string because its of reference type and you can console write a null integer which will be nothing on screen. please Sir , you need to give much care

1 answer

Last reply by: John Snape
Thu Feb 4, 2016 12:12 AM

Post by Salman Khan on June 22, 2015

I have been struggling for almost 3-4 days with the concept of floating-point numbers. It involves really hard mathematics and we should also understand fixed-point numbers as well. it is very hard to do. I've been trying to go through different sources, like the book "Computer Organization and Architecture" by William Stallings. Why this topic was just touched so briefly upon? It is not so trivial and is very hard.  
P.S. i'm not that good in Mathematics, just finished A level high school.

1 answer

Last reply by: John Snape
Thu Mar 26, 2015 10:52 AM

Post by Keith Lashley on March 26, 2015

My Visual Studio claims that my projects were not loaded correctly when I try to open them.  What is wrong?  Can you help me please.

Declaring Variables

  • The standard variable declaration statement is:
    • [datatype] variable = [value];
  • Value types hold their data directly
  • Reference types only hold a pointer to the actual data somewhere else in memory
  • All built-in numeric types are value types
  • Use a data type with enough precision for the work you need to do
  • You have to give some value to a variable before you use it or you will get an error
  • Constants never change during the program execution
  • Constants can be any data type
  • Usually all uppercase so they are easily seen when scanning code
  • Implicit conversions are always allowed for widening conversions (where the source data type is less precise than the destination data type)
  • Explicit conversions are for narrowing conversions
  • Null means "never entered"
  • Use ? after the datatype in the declaration for nullable variables
  • Boolean is a "Yes or No"/"True or False" type variable
  • False always converts to/from zero
  • Although discouraged, you can use a reserved word for a variable name by always starting it with @