English
Tamil Nadu Board of Secondary EducationHSC Science Class 11

Why is char often treated as an integer data type? - Computer Science

Advertisements
Advertisements

Question

Why is char often treated as an integer data type?

Short Note

Solution

Character data type accepts and returns all valid ASCII characters. The character data type is often said to be an integer type since all the characters are represented in memory by their associated ASCII Codes. If a variable is declared as char, C++ allows storing either a character or an integer value.

shaalaa.com
Data Types
  Is there an error in this question or solution?
Chapter 9: Introduction to C++ - Data Types, Variables and Expressions - Evaluation - Section - B [Page 150]

APPEARS IN

Samacheer Kalvi Computer Science [English] Class 11 TN Board
Chapter 9 Introduction to C++
Data Types, Variables and Expressions - Evaluation - Section - B | Q 3. | Page 150
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×