Can Variable Name Start with _?

In most languages _ is the only character allowed in variable names besides letters and numbers. Here are some common use cases: Separating words: some_variable. Private variables start with underscores: _private.

Can a variable name start with underscore?

Variable names should not start with underscore ( _ ) or dollar sign ( $ ) characters, even though both are allowed. This is in contrast to other coding conventions that state that underscores should be used to prefix all instance variables.

Can a variable name start with underscore in C?

Yes. A variable name can start with underscore in C programming language.

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.