fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. cout<<"sizeof(\"x\") = " <<sizeof("x") <<endl<<"sizeof('x') = " <<sizeof('x') <<endl;
  6.  
  7. cout<<"Content of \"x\" are(in Hexadecimal): "<<endl;
  8. char x[] = "x";
  9. cout.setf(ios::hex, ios::basefield);
  10. for(int i=0; i<sizeof("x"); i++)
  11. cout<<"\t "<<(int)x[i] <<endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 4400KB
stdin
Standard input is empty
stdout
sizeof("x") = 2
sizeof('x') = 1
Content of "x" are(in Hexadecimal): 
	 78
	 0