Created
January 17, 2023 19:16
-
-
Save TaylorHawkes/a321297d1b33e5eb36dd09a7cb4f5179 to your computer and use it in GitHub Desktop.
data type size in cpp in number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout << "Size of char: " << sizeof(char) << " byte" << endl; | |
cout << "Size of int: " << sizeof(int) << " bytes" << endl; | |
cout << "Size of float: " << sizeof(float) << " bytes" << endl; | |
cout << "Size of double: " << sizeof(double) << " bytes" << endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: https://www.grepper.com/tpc/data+type+size+in+cpp+in+number