DEV Community

Mirsoli Mirzaahmad õğli
Mirsoli Mirzaahmad õğli

Posted on • Edited on

2 2

Lesson 01 | Variables

C Variable Names

In C variable names must follow specific rules:

  • Names can only be composed of upper and lower case letters, numbers, and underscores.
  • The first character must be a letter (upper or lower case).
  • No keywords are allowed as the full name (int is not allowed but int_count would work).

Data Types in C

The main data types in C are: int, float, double, and char.

Setting Variables in C

Variables in C can be initialized with values at their declaration or have their values set later in the code.

Variable Casting in C

In C a variable can be cast explicitly or implicitly from one data type to another. They can then be used directly or stored in another variable.

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

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay