Ask Question
30 September, 10:56

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?

+2
Answers (1)
  1. 30 September, 11:18
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers