0 votes
124 views
in C program by (98.9k points)
edited

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

1 Answer

0 votes
by (98.9k points)
selected by
 
Best answer
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.

Related questions

0 votes
1 answer 159 views
asked May 14, 2022 in C program by Doubtly (98.9k points)
0 votes
1 answer 129 views
0 votes
1 answer 142 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

549 users

...