String Constants





String Constants

  • The phrase in quotation marks, "Welcome to this course\n", is an example of a string constant.
  • A constant, unlike a variable, cannot be given a new value as the program runs. Its value is set when the program is written, and it retains this value throughout the program’s existence.
  • The '\n' character at the end of the string constant is an example of an escape sequence.
  • The '\n' causes the next text output to be displayed on a new line.
  • Line no. 2 and 3 in our program are called directives. The first is a preprocessor directive,and the second is a using directive.




Comments