Home
124 IELTS
AMAN IELTS
iEnglish Guru
Books
Support Us
Contact Us
Sunday, November 4, 2018
What are variables? List C++ rules for variables naming.
November 04, 2018
BCA-3rd Sem
,
C++
,
Question Answer
No comments
Naming Rules for Variables
The names of variables in the C++ language are referred to as
identifiers
. The best naming convention is to choose a variable name that will tell the reader of the program what the variable represents. Variables that describe the data stored at that particular memory location are called
mnemonic variables
.
Rules for naming variables:
Variable names in Visual C++ can range from 1 to 255 characters. To make variable names portable to other environments stay within a 1 to 31 character range.
All variable names must begin with a letter of the alphabet or an
underscore( _ ). For beginning programmers, it may be easier to begin all variable names with a letter of the alphabet.
After the first initial letter, variable names can also contain letters and numbers. No spaces or special characters, however, are allowed.
Uppercase characters are distinct from lowercase characters. Using all uppercase letters is used primarily to identify constant variables.
You cannot use a C++ keyword (reserved word) as a variable name.
Tip:
Some programmers use an underscore in variable names to separate parts of the name, such as
shipping_weight
.
Others prefer a "capital style" notation, such as
shippingWeight
to separate parts of the name.
NEVER use uppercase for every letter in a variable name, because uppercase names are reserved for constant variables.
Samples of acceptable variable names:
Samples of unacceptable variable names:
Grade
Grade(Test)
GradeOnTest
GradeTest#1
Grade_On_Test
3rd_Test_Grade
Email This
BlogThis!
Share to X
Share to Facebook
Newer Post
Older Post
Home
0 comments:
Post a Comment
Social Profiles
124 IELTS
Submission
Interest Calculator
Games Portal
Universities
Categories
Academic Task 2
BCA
Question Answer
BCA-3rd Sem
Reading Test
Question Paper
IELTS
Ebook
Academic Task 1
BCA-6th Sem
Computer Networks
BCA-5th Sem
Books
C++
MIS
Our Products
Java
Education
HTML
Speaking
BCA English
Software Engineering
Punjabi
Tips & Techniques
Other Material
GT Writing
General Reading
Notes
BCA-1st Sem
CELPIP
Library
ASP.NET
BCA-4th Sem
E-Commerce
GK
Grammar
Prediction
book
B.Tech
B.com
BBA
Free Ebooks
Google
MBA
MCA
PTU
PU CHD
Syllabus
System Software
offers
Academic Task 2 VOCAB
B.A
CBSC
Date Sheet
Delhi University
English Grammar
Free Books
ICSE
LINKING WORDS
Learn Punjabi
Microsoft
Mock Test
News
P.HD
Press Release
Popular
Tags
Blog Archives
Punjabi University Patiala All Last Year Question Papers Download Here from 124Study App
ROBERT ANTHONY’S HIERARCHY OF MANAGEMENT ACTIVITY by 124study
Some people think that instead of preventing climate change, we need to find a way to live with it. To what extent do you agree or disagree? || AMAN IELTS IELTS IELTS IELTS IELTS
0 comments:
Post a Comment