How to declare and initialize a string?
Answers
Answered by
0
To declare and initialize a string variable:
1.Type string str where str is the name of the variable to hold the string.
2.Type ="My String" where "My String" is the string you wish to store in the string variable declared in step 1.
3.Type ; (a semicolon) to end the statement
Answered by
0
To declare and also initialize a string variable, please follow the procedure:
Step1: Write string str, str stands for the string variable name which you should put.
Step2: Write MyString, where you wish to store your string in string variable in step 1.
Step3: End the program statement with a semicolon.
Similar questions
Physics,
7 months ago
English,
7 months ago
Math,
1 year ago
Environmental Sciences,
1 year ago
Social Sciences,
1 year ago