Search
 
SCRIPT & CODE EXAMPLE
 

CPP

get type of variable in c++

auto a = 10;
cout << typeid(a) << endl;
Comment

c++ type of a variable

#include<iostream>
using namespace std;
main()
{
auto variable = 45;
cout << typeid(variable).name() << endl;
}
Comment

how to get the type of a variable in c++

int a = 5;
cout << typeid(a).name() << endl;
Comment

PREVIOUS NEXT
Code Example
Cpp :: size of stack in c++ 
Cpp :: how to use char in c++ 
Cpp :: upcasting in c++ 
Cpp :: how to find 2d vector length cpp 
Cpp :: stoi cpp 
Cpp :: C++ String Length Example 
Cpp :: run cmd command c++ 
Cpp :: how to dynamically allocate an array c++ 
Cpp :: convert unsigned long to string c++ 
Cpp :: c++ cstring to string 
Cpp :: initialize vector of vector c++ 
Cpp :: pascal triangle using c++ 
Cpp :: cannot jump from switch statement to this case label c++ 
Cpp :: how to find last character of string in c++ 
Cpp :: c++ vector resize 
Cpp :: how to convert ascii to char in cpp 
Cpp :: find kth max and min element in an array 
Cpp :: array to string c++ 
Cpp :: float to int c++ 
Cpp :: c ifdef 
Cpp :: C++ code for Dijkstra’s Algorithm 
Cpp :: c++ program to convert kelvin to fahrenheit 
Cpp :: list in c++ 
Cpp :: cin exceptions c++ 
Cpp :: best time to buy and sell stock leetcode solution 
Cpp :: map in cpp 
Cpp :: inheritance example in C plus plus 
Cpp :: c++ data types 
Cpp :: how to make dictionary of numbers in c++ 
Cpp :: sum of first 100 natural numbers 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =