Answers for "c++ declare int"

C++
1

how to declare an integer in c++

type variable = value;
Posted by: Guest on September-09-2021
0

how to write int variable c++

//Declare integer variable in C++
int x;
//Initialize integer variable
x = 1;

//Declaring and Initialize in same line
int y = 0;
Posted by: Guest on March-20-2021
0

intlen in c++

// getting the legth of an int by turning it into a string
// works with double and float too

#include <iostream>

int num = 0;

// turning num into a string using std::string
std::string temp = std::to_string(num);

// getting the length using .length()
int len = temp.length();
Posted by: Guest on January-11-2021

Browse Popular Code Answers by Language