Learn c#
  • Overview
  • Chapter 0 c# vs .net
  • Chapter 1 Definitions
    • Data Types (Primitive Types)
    • Variables
    • Overflow
    • Identifiers
    • Comments
  • Chapter 2 Type Conversions
  • Chapter 3 C# Operators
  • Chapter 4 Non-Primitive Types
    • Reference Types and value types
    • Class, Fields, property
    • Structs and Arrays
    • Strings
    • Enums
  • Chapter 5 Conditional statements and Loops
    • Conditional Statements
    • Random Class
  • External Links
    • cSharp-Station
    • cSharp corner
    • CodeProject
    • cSharp Guide by Microsoft
  • Tips
Powered by GitBook
On this page

Tips

PreviousExternal Links

Last updated 6 years ago

  • For consolewriteline, use cw and press tab. It will resolve to consolewriteline automatically.

  • Use ctrl + x, on windows and command + x on Mac to delete individual lines on visual studio.

  • To get a first value, check if the data type has misvalue and maxvalue parameters. You can directly say, console.writeline(“{0} {1} ”, byte.minvalue, byte.maxvalue) and console.writeline(“{0} {1} ”, float.minvalue, float.maxvalue) to show start value and end value that a byte and float datatypes can support.

  • If you have all classes in one file, your script will look very very long. So, place cursor on the class name and hit alt enter and choose move classname to classname.cs. This would create new file with class name and add .cs extension.

  • You can also create a folder in your project. Now when you want to access class in that folder, you have to specify that folder with namespace as, using namespace.foldername. If not csharp compiler cannot identify classes in that folders.

  • If you want to allocate memory, you have to use new keyword.