Home / Questions / How do you declare a variable that will hold string values?
Explanatory Question

How do you declare a variable that will hold string values?

👁 4,658 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

The char keyword can only hold 1 character value at a time. By creating an array of characters, you can store string values in it. Example: "char MyName[50]; " declares a string variable named MyName that can hold a maximum of 50 characters.