Strings and Difference between Declaring and initializing a Variable
Q5: What are strings in C++?
Answer:
Strings in C++:
Strings are variables that can store non numerical that are longer than one single character are known as strings. Strings in C++ are also defined as an array of characters.
Q6: What is the difference between declaring and initializing a variable?
Answer:
Declaring:
Declaring a variable means the first “mention” of the variable, which tells the compiler “Hello, I am here and can be used”.
String name; int nbr;
Initializing:
The term initialization usually means the first assignment of a value to a variable.
String name = "Thomas"; int nbr = 5;
Comments
Post a Comment