Introduction to Data Types
This article aims to provide a comprehensive understanding of data types, including an explanation of the concepts of "static", "dynamic", "strong", and "weak" when discussing data types.
What Are Data Types?
# Assigning the value "Ali Nasiri" to the variable 'name'.
name = "Ali Nasiri"
print(name)Static and Dynamic Data Typing Systems
#include <iostream>
using namespace std;
int main() {
int age = 25; // Here, the variable 'age' is declared and assigned an integer value.
cout << "Age: " << age << endl;
// age = "30"; // Uncommenting this line will result in a compilation error.
// The variable 'age' is of type 'int', and assigning a string value will violate the static typing rules.
float height = 1.75; // The variable 'height' is declared and assigned a float value.
cout << "Height: " << height << endl;
return 0;
}Strong and Weak Data Typing Systems
Last updated