Revision: 859
http://assorted.svn.sourceforge.net/assorted/?rev=859&view=rev
Author: yangzhang
Date: 2008-07-01 22:23:33 -0700 (Tue, 01 Jul 2008)
Log Message:
-----------
added long long int test
Added Paths:
-----------
sandbox/trunk/src/cc/longlongint.cc
Added: sandbox/trunk/src/cc/longlongint.cc
===================================================================
--- sandbox/trunk/src/cc/longlongint.cc (rev 0)
+++ sandbox/trunk/src/cc/longlongint.cc 2008-07-02 05:23:33 UTC (rev 859)
@@ -0,0 +1,34 @@
+#include <iostream>
+#include <string>
+#include <typeinfo>
+
+using namespace std;
+
+void f(int64_t x) { cout << x << endl; }
+void f(int32_t x) { cout << x << endl; }
+void f(int16_t x) { cout << x << endl; }
+void f(int8_t x) { cout << x << endl; }
+void f(double x) { cout << x << endl; }
+void f(float x) { cout << x << endl; }
+void f(string& x) { cout << x << endl; }
+
+int
+main()
+{
+// long long int x = 32;
+ long int x = 32;
+ f(x);
+ int64_t y = 32;
+ f(y);
+// f(0LL);
+ cout << sizeof(int64_t) << endl;
+ cout << sizeof(long long) << endl;
+ cout << sizeof(long int) << endl;
+ cout << sizeof(long) << endl;
+ cout << sizeof(0LL) << endl;
+ cout << sizeof(0L) << endl;
+ cout << typeid(int64_t).name() << endl;
+ cout << typeid(long long).name() << endl;
+ cout << typeid(string).name() << endl;
+ return 0;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|