100 COMMONLY USED WORDS IN c++

1-10: Basic Syntax

  1. int: A fundamental data type used to declare integer variables.
  2. float: A floating-point data type for decimal values.
  3. double: Double-precision floating-point numbers, more accurate than float.
  4. char: Used for storing single characters.
  5. bool: Represents Boolean values (true or false).
  6. void: Denotes no return value for a function.
  7. if: Conditional statement that executes code based on a condition.
  8. else: Provides an alternative block of code when an if condition is false.
  9. switch: A control statement that selects one of many code blocks to execute.
  10. for: A loop that repeats code a specified number of times.

Reference: C++ Basics – GeeksforGeeks

11-20: Advanced Data Types

  1. struct: A collection of variables grouped under one name.
  2. class: Blueprint for objects, bundling methods and attributes.
  3. union: A data structure where all members share the same memory location.
  4. enum: Defines a set of named integral constants.
  5. array: A collection of variables of the same type stored at contiguous memory locations.
  6. string: Represents sequences of characters, commonly used from the Standard Template Library (STL).
  7. vector: A dynamic array provided by the STL.
  8. list: Doubly linked list in STL, allowing insertion and deletion anywhere.
  9. map: A key-value pair container in STL.
  10. pair: A container for two values.

Reference: STL Containers – CPlusPlus

21-30: Input/Output

  1. cin: Standard input stream.
  2. cout: Standard output stream.
  3. cerr: Standard error stream.
  4. clog: Standard log stream.
  5. endl: Ends a line in output and flushes the stream.
  6. gets: Reads a string until a newline character (not safe to use due to buffer overflow risks).
  7. puts: Outputs a string followed by a newline.
  8. getline(): Reads a full line of input, including spaces.
  9. fprintf: Prints formatted output to a file.
  10. fscanf: Reads formatted input from a file.

Reference: C++ Input/Output – CPlusPlus

31-40: Operators

  1. +: Addition operator.
  2. -: Subtraction operator.
  3. *: Multiplication operator.
  4. /: Division operator.
  5. %: Modulus operator (remainder of division).
  6. ++: Increment operator.
  7. --: Decrement operator.
  8. &&: Logical AND operator.
  9. ||: Logical OR operator.
  10. !: Logical NOT operator.

Reference: C++ Operators – Programiz

41-50: Control Flow

  1. while: Repeats a block of code while a condition is true.
  2. do-while: Similar to while, but checks the condition after executing the loop.
  3. break: Terminates a loop or switch statement.
  4. continue: Skips the current iteration of a loop.
  5. goto: Jumps to another point in the program.
  6. return: Exits a function and optionally returns a value.
  7. try: Starts a block of code for exception handling.
  8. catch: Handles exceptions thrown by try.
  9. throw: Throws an exception.
  10. exit(): Terminates a program.

Reference: Control Statements – GeeksforGeeks

51-60: Functions

  1. main(): The entry point of a C++ program.
  2. inline: Suggests that the compiler replaces a function call with the function’s code to optimize performance.
  3. const: Declares variables or parameters as constant.
  4. static: Keeps a local variable’s value between function calls or restricts the visibility of a variable or function to a file.
  5. friend: Allows a function or class to access private and protected members of another class.
  6. virtual: Allows a function to be overridden in derived classes.
  7. overloading: Multiple functions can have the same name with different parameters.
  8. template: Allows writing generic programs.
  9. recursion: A function that calls itself.
  10. lambda: An anonymous function that can be defined inline.

Reference: C++ Functions – TutorialsPoint

61-70: Pointers & References

  1. &: Address-of operator, used to get the memory address of a variable.
  2. *: Dereference operator, used to access the value at the address pointed to by a pointer.
  3. nullptr: Represents a null pointer.
  4. new: Allocates memory dynamically.
  5. delete: Frees memory allocated by new.
  6. reference: An alias for another variable.
  7. pointer: Stores the address of a variable.
  8. smart pointer: Automatically manages memory, like std::unique_ptr and std::shared_ptr.
  9. dangling pointer: A pointer that no longer points to valid memory.
  10. memory leak: Occurs when dynamically allocated memory is not properly freed.

Reference: C++ Pointers – Programiz

71-80: Object-Oriented Programming (OOP)

  1. constructor: Initializes an object.
  2. destructor: Cleans up when an object goes out of scope.
  3. inheritance: Deriving a class from another class.
  4. polymorphism: Allows one interface to be used for different data types.
  5. abstraction: Hiding implementation details from the user.
  6. encapsulation: Wrapping data and methods into a single unit or class.
  7. overriding: Redefining a base class’s method in a derived class.
  8. this: Pointer to the current object.
  9. operator overloading: Defining how operators work for user-defined types.
  10. multiple inheritance: A class can inherit from more than one base class.

Reference: OOP in C++ – GeeksforGeeks

81-90: Standard Template Library (STL)

  1. algorithm: A header that includes many common algorithms like sort(), find(), etc.
  2. vector: Dynamic array.
  3. deque: Double-ended queue.
  4. stack: Last-in, first-out container.
  5. queue: First-in, first-out container.
  6. priority_queue: A heap-based queue.
  7. set: Collection of unique elements.
  8. multiset: Collection of non-unique elements.
  9. map: Key-value pair container.
  10. unordered_map: Hash-based key-value container.

Reference: C++ STL – CPlusPlus

91-100: Miscellaneous

  1. namespace: Avoids name conflicts by organizing code into logical groups.
  2. typedef: Defines a new name for an existing type.
  3. typeid: Provides runtime type information.
  4. auto: Automatically deduces the type of a variable.
  5. decltype: Deduces the type of an expression.
  6. constexpr: Used to define constant expressions.
  7. static_cast: A type cast used for well-defined conversions.
  8. dynamic_cast: Safely casts between base and derived classes.
  9. mutable: Allows a class member to be modified, even if the object is const.
  10. volatile: Tells the compiler that a variable can be changed unexpectedly, such as in a multi-threaded environment.

Reference: [C++ Advanced Concepts – Programiz](https://www.programiz.com/cpp-programming

Leave a Reply

Your email address will not be published. Required fields are marked *

Resize text
Scroll to Top