Ask Question
21 May, 11:58

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?

+3
Answers (1)
  1. 21 May, 14:11
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers