Ask Question
1 September, 23:55

The C programming language distinguishes character constants from string constants by using single quotation marks for characters and double quotation marks for strings. Thus, 'c' is the character c, while "c" is a string of length 1 consisting of the single character c.

1. Why do you think this distinction is made? Is it useful?

+5
Answers (1)
  1. 2 September, 02:15
    0
    The C programming language distinguishes character constants from string constants by

    using single quotation marks for characters and double quotation marks for strings. Thus,

    'c' is the character c, while "c" is a string of length 1 consisting of the single character c.

    Why do you think this distinction is made? Is it useful?

    (b) Python, on the other hand, uses double quotation marks for both characters and strings

    (thus, "c" is either a character or string, depending on context). Discuss the advantages and

    disadvantages of these two approaches.

    6.3 Discuss the pros and cons of ignoring or requiring "white space" (i. e., blanks, end-of-lines, and

    tabs) when recognizing tokens.

    6.4 Many programming languages (like C) do not allow nested comments. Why is this requirement

    made? Modula-2 and a few other languages do allow nested comments. Why is this useful?

    6.5 (a) Describe the strings that are represented by the regular expression:

    [0-9] + ((E|e) (/+|/-) ?[0-9]+) ?

    (b) Write a regular expression for C identifiers consisting of letters, digits, and the underscore

    character '_', and starting with a letter or underscore.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “The C programming language distinguishes character constants from string constants by using single quotation marks for characters and ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers