DEV Community

Kyle Martin
Kyle Martin

Posted on • Edited on

The built in types of C#

Variables are an essential part of any programming language. Variables allow you to store and manipulate data during the execution of your code.

In this post I will be writing about the built-in types in the C# language. These are known as integral numeric, floating point numeric, bool, and char. The aspects to these variables are declarations, initialization, scope, assignment, and modification.

char firstLetter = 'a';
int age = 33;
double cost = 1337.00;
bool isOpen = false;
Enter fullscreen mode Exit fullscreen mode

In the example above I have declared and initialized the four simple type variables in C#. It starts with first defining the type the variable will be, naming the variable, and assigning a value to the variable. You don't always need to assign a value to the variable upon declaring the variable.

char firstLetter;
int age;
double cost;
bool isOpen;
Enter fullscreen mode Exit fullscreen mode

In the examples above I have described how to define, initialize, and assign variables in C#. I have recently started a blog to help jot down my programming education / learnings that I have picked up over the last five years. I go more in depth on modification and scope of variables in C# in the latest post published today. If you are interested check it out.

My blog: https://kylemartin0819.wordpress.com/

I plan on creating concise, short read, lessons here on Dev.to that summarize my blog posts as well so consider giving me a like and follow. Check out my GitHub where I have been storing C# code from online courses / books I have been digesting recently.

Thanks for reading!

Kyle

Heroku

Built for developers, by developers.

Whether you're building a simple prototype or a business-critical product, Heroku's fully-managed platform gives you the simplest path to delivering apps quickly — using the tools and languages you already love!

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay