Skip to content

Instantly share code, notes, and snippets.

@TaylorHawkes
Created January 17, 2023 19:16
Show Gist options
  • Save TaylorHawkes/a321297d1b33e5eb36dd09a7cb4f5179 to your computer and use it in GitHub Desktop.
Save TaylorHawkes/a321297d1b33e5eb36dd09a7cb4f5179 to your computer and use it in GitHub Desktop.
data type size in cpp in number
#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;
}
@TaylorHawkes
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment