Register
 

Free CSC Scholarship support for 2018-19

Engineering, Computer, Scholarship and SEO Support Forum




Author Topic: What is the difference between the constants 7, '7', and "7"?  (Read 117 times)

Offline mechanic

  • Engineer
  • Hero Engineer
  • *****
  • Posts: 3066
    • View Profile
    • Engineering Forum
Advertisement
What is the difference between the constants 7, '7', and "7"?

Answer:

The constant 7 is the integer 7 (the number you get when you add 3 and 4). The constant '7' is a character constant consisting of the character `7' (the key between `6' and `8' on the keyboard, which also has a `&' on it on mine). The constant "7" is a string constant consisting of one character, the character `7'.

Engineering, Computer, Scholarship and SEO Support Forum