0

Does this code gives size of variable i.e based upon operator ....does it give size of operations

#include <iostream> using namespace std; int main() { cout << "char: " << sizeof(char) << endl; cout << "int: " << sizeof(int) << endl; cout << "float: " << sizeof(float) << endl; cout << "double: " << sizeof(double) << endl; int var = 50; cout << "var: " << sizeof(var) << endl; int a,b,c; int a=10; int b= 20; int c= 30; cout<< "value of sum"<< a+b+c<< endl; cout << a+b+c<< sizeof(b)<<endl; return 0; }

3rd May 2019, 4:56 PM
Tiwary Sourav
Tiwary Sourav - avatar
2 Antworten
3rd May 2019, 4:58 PM
Seniru
Seniru - avatar
+ 1
Wikipedia gives detailed explanation of this operator: https://en.m.wikipedia.org/wiki/Sizeof
3rd May 2019, 5:18 PM
Ipang