Skip to content

Instantly share code, notes, and snippets.

@uemuraj
Last active February 10, 2021 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uemuraj/ac1bf1e2205705606c4389c46e346c67 to your computer and use it in GitHub Desktop.
Save uemuraj/ac1bf1e2205705606c4389c46e346c67 to your computer and use it in GitHub Desktop.
using namespace std;
int main()
{
int x = 255;
cout << setw(10) << setfill('0') << showbase << hex;
cout << x << endl;
cout << x << endl;
cout << setw(10) << x << endl;
cout << endl;
cout << setw(10) << setfill('0') << internal << showbase << hex;
cout << x << endl;
cout << x << endl;
cout << setw(10) << x << endl;
return 0;
}
@uemuraj
Copy link
Author

uemuraj commented Feb 10, 2021

実行結果はこうなる...

0000000xff
0xff
0000000xff

0x000000ff
0xff
0x000000ff

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