Bernard Aybouts - Blog - MiltonMarketing.com

FAQ: What are the different data types present in C++?

FAQ

Approx read time: 1.7 min.

What are the different data types present in C++?

  1. Fundamental Data Types:

  • int: Represents integers.
  • float: Represents single-precision floating-point numbers.
  • double: Represents double-precision floating-point numbers.
  • char: Represents single characters.
  • bool: Represents Boolean values (true or false).
  • void: Represents the absence of type.
  • wchar_t: Represents wide characters (larger character set than char).
  1. Modifier Types:

These are used with the fundamental types to alter their meaning.

  • signed: Makes a type store both negative and positive values.
  • unsigned: Makes a type store only non-negative values.
  • short: Used with int to create a smaller integer type.
  • long: Used with int to create a larger integer type.
  • long long: Used with int for an even larger integer type (C++11 onward).
  1. Derived Data Types:

These types are derived from the fundamental data types.

  • Arrays: Collection of data items of the same type.
  • Pointer: Variable that stores the memory address of another variable.
  • Reference: An alias for an already existing variable.
  • Function: Set of statements that performs a task.
  1. User-Defined Data Types:

These types allow users to define their own data types.

  • enum: Enumeration, a way of defining named integer constants.
  • struct: Structure, a collection of variables (possibly of different types) under a single name.
  • union: Similar to struct, but all members share the same memory location.
  • class: The central feature of C++ that supports Object-Oriented Programming. It can contain variables and functions.
  1. Complex or Compound Data Types:

These are more advanced data types often used in C++.

  • string: Represents sequences of characters (technically, it’s a class from the C++ Standard Library).
  • vector, list, map, etc.: Part of the C++ Standard Template Library (STL), used for creating complex data structures like dynamic arrays, linked lists, etc.

Related Posts:

What are the differences between C++ and Java?(Opens in a new browser tab)

What are JavaScript Data Types?(Opens in a new browser tab)

Introduction to JavaScript – Review Types and Operators(Opens in a new browser tab)

Hackers attack Confluence Servers, hijack power for cryptocurrency mining(Opens in a new browser tab)

A Retrospective: Diana Roy’s Invisible Majority(Opens in a new browser tab)

Leave A Comment


About the Author: Bernard Aybout (Virii8)

Avatar of Bernard Aybout (Virii8)
I am a dedicated technology enthusiast with over 45 years of life experience, passionate about computers, AI, emerging technologies, and their real-world impact. As the founder of my personal blog, MiltonMarketing.com, I explore how AI, health tech, engineering, finance, and other advanced fields leverage innovation—not as a replacement for human expertise, but as a tool to enhance it. My focus is on bridging the gap between cutting-edge technology and practical applications, ensuring ethical, responsible, and transformative use across industries. MiltonMarketing.com is more than just a tech blog—it's a growing platform for expert insights. We welcome qualified writers and industry professionals from IT, AI, healthcare, engineering, HVAC, automotive, finance, and beyond to contribute their knowledge. If you have expertise to share in how AI and technology shape industries while complementing human skills, join us in driving meaningful conversations about the future of innovation. 🚀