En:
Creating a variable reserves a memory location, or a space in memory for storing values. The compiler requires that you provide a data type for each variable you declare.
C++ offer a rich assortment of built-in as well as user defined data types.
Integer, a built-in type, represents a wholenumber value. Define integer using the keyword int.
C++ requires that you specify the type and the identifier for each variable defined.
An identifier is a name for a variable, function, class, module, or any other user-defined item. An identifier starts with a letter (A-Z or a-z) or an underscore (_), followed by additional letters, underscores, and digits (0 to 9).
For example, define a variable called myVariable that can hold integer values as follows:int myVariable = 10;
Vn:
Tạo ra biến giữ 1 vị trí bộ nhớ,một không gian lưu trữ giá trị .Trình biên dịch yêu cầu bạn cung cấp một kiểu dữ liệu cho mỗi biến bạn khai báo.C++ cũng cung cấp nhiều kiểu giá trị ví dụ :int, long, float,…….
C++ cũng yêu cầu bạn đặt tên cho lại biến đó .Quy định tên biến đó bắt đầu bằng 1 chữ cái (A-Z hoặc a-z) hoặc cái gach dưới(_), tiếp theo là là chữ , số (0-9) ,(_).
Ví dụ: int myVariable = 10;
thì hiểu như biến myVariable có kiểu dữ liệu integer và có giá trị = 10
Chú Ý: Trong 1 void hay function bạn không được thay đổi quá 1 lần kiểu dữ liệu của biến
P/s: Qua bài này mình thấy càng làm blog mình càng nhác chứng mình không kiên trì rồi !(Nhác ở đây là nhác dịch :()