how to check type in c++
C++
#include <typeinfo>
#include <iostream>
class someClass { };
int main(int argc, char* argv[]) {
int a;
someClass b;
std::cout<<"a is of type: "<<typeid(a).name()<<std::endl;
// Output 'a is of type int'
std::cout<<"b is of type: "<<typeid(b).name()<<std::endl;
// Output 'b is of type someClass'
return 0;
// on the online compiler it comes as 'i' for int and 'c' for char
}
Also in C++:
- Title
- how to initialize a vector in c++
- Category
- C++
- Title
- pair in c++
- Category
- C++
- Title
- unordered_set in c++ and ordered set diff
- Category
- C++
- Title
- c++ string to vector int
- Category
- C++
- Title
- c++ compiler for sublime text
- Category
- C++
- Title
- cpp nan value
- Category
- C++
- Title
- 2927260.eps 2927262.jpg 2927263.ai License free.txt License premium.txt
- Category
- C++
- Title
- first fit algorithm
- Category
- C++
- Title
- Temporary file using MSFT API in cpp
- Category
- C++
- Title
- trovare il valore massimo in un array c++ w3
- Category
- C++
- Title
- c++ class inheritance
- Category
- C++
- Title
- c++ pointers
- Category
- C++
- Title
- primeros numeors primos menores que
- Category
- C++
- Title
- how to include seld declared header file in c++
- Category
- C++
- Title
- c++ public inheritance not getting protected
- Category
- C++
- Title
- calling by reference and pointers c++
- Category
- C++
- Title
- how to iterate over unordered_map c++
- Category
- C++
- Title
- sort function in c++
- Category
- C++
- Title
- find_if c++
- Category
- C++
- Title
- pass ss tream as parameter c++
- Category
- C++
- Title
- fmod c++
- Category
- C++
- Title
- how to make loop in c++
- Category
- C++
- Title
- primeros numeros primos
- Category
- C++
- Title
- how to end a c++ program early
- Category
- C++
- Title
- c++ function to find minimum element in array
- Category
- C++
- Title
- access last element in vector in c++
- Category
- C++
- Title
- is x prime?
- Category
- C++
- Title
- binary serach in c++
- Category
- C++
- Title
- range based for loop c++
- Category
- C++
- Title
- pass vector by reference c++
- Category
- C++
- Title
- min heap declaration in c++ stl
- Category
- C++
- Title
- getch c++ library
- Category
- C++
- Title
- c++ read matttrix from text file
- Category
- C++
- Title
- binary search stl in c++
- Category
- C++
- Title
- varint index
- Category
- C++
- Title
- Html tab
- Category
- C++
- Title
- c++ files
- Category
- C++
- Title
- how to print to the serial monitor arduino
- Category
- C++
- Title
- convert int to binary string c++
- Category
- C++
- Title
- reverse a linked list using recursion
- Category
- C++
- Title
- binary tree search
- Category
- C++
- Title
- find upper bound c++ vector
- Category
- C++
- Title
- bool function in c++
- Category
- C++
- Title
- queue stl c++
- Category
- C++
- Title
- c++ get last element in vector
- Category
- C++
- Title
- shuffle vector c++
- Category
- C++
- Title
- pow c++
- Category
- C++
- Title
- modulo c++
- Category
- C++
- Title
- sort a pair using c++ stl
- Category
- C++
- Title
- c++ yes no question
- Category
- C++
- Title
- initialize int c++
- Category
- C++
- Title
- get index of value c++
- Category
- C++
- Title
- how to output text in c++
- Category
- C++
- Title
- cin.ignore
- Category
- C++
- Title
- unsorted array to bst
- Category
- C++
- Title
- c++ map insert
- Category
- C++
- Title
- how to switch to another branch in git
- Category
- C++
- Title
- inheritance protected in c++
- Category
- C++
- Title
- C++ string format ctime
- Category
- C++
- Title
- apple and orange hackerrank solution in c++
- Category
- C++
- Title
- hohw toparse a string in c++
- Category
- C++
- Title
- double to int c++
- Category
- C++
- Title
- how to append one vector to another c++
- Category
- C++
- Title
- c++ short if
- Category
- C++
- Title
- c++ max of array
- Category
- C++
- Title
- c++ char to string
- Category
- C++
- Title
- how to format decimal palces in c++
- Category
- C++
- Title
- user input c++
- Category
- C++
- Title
- loop through words in string c++
- Category
- C++
- Title
- mkdir c++
- Category
- C++
- Title
- checking an int in c++
- Category
- C++
- Title
- set lower bound c++
- Category
- C++
- Title
- nginx linux
- Category
- C++
- Title
- recursion in cpp with reference
- Category
- C++
- Title
- COnvert string to char * C++
- Category
- C++
- Title
- hashset in c++
- Category
- C++
- Title
- how to round to nearest whole number unity
- Category
- C++
- Title
- appending a double to a string c++
- Category
- C++
- Title
- how to have a queue as a parameter in c++
- Category
- C++
- Title
- convert integer to string c++
- Category
- C++
- Title
- caesar cipher program in c++
- Category
- C++
- Title
- powers of 2 in cpp
- Category
- C++
- Title
- how the theam are store in database
- Category
- C++
- Title
- c++ remove element from vector
- Category
- C++
- Title
- how to get the largest number in a c++ array
- Category
- C++
- Title
- std::substring
- Category
- C++
- Title
- length of string in c++
- Category
- C++
- Title
- calculate factorial
- Category
- C++
- Title
- c++ scanf
- Category
- C++
- Title
- char* to int in cpp
- Category
- C++
- Title
- call by reference c++ example
- Category
- C++
- Title
- mkdir boost filesystem
- Category
- C++
- Title
- insert function in c++ vector
- Category
- C++
- Title
- find_if c++ example
- Category
- C++
- Title
- mao two drivers c++
- Category
- C++
- Title
- visual studio 2019 c++ tutorial project
- Category
- C++
- Title
- how to convert n space separated integers in c++
- Category
- C++
- Title
- size of a matrix c++
- Category
- C++
- Title
- how to sort an array according to another array c++
- Category
- C++
- Title
- pass by reference c++
- Category
- C++