summaryrefslogtreecommitdiff
path: root/userspace/cpp/testcpp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'userspace/cpp/testcpp.cpp')
-rw-r--r--userspace/cpp/testcpp.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/userspace/cpp/testcpp.cpp b/userspace/cpp/testcpp.cpp
index 0e89276..53e3a3b 100644
--- a/userspace/cpp/testcpp.cpp
+++ b/userspace/cpp/testcpp.cpp
@@ -1,4 +1,35 @@
+#include <algorithm>
+#include <vector>
+#include <cstdio>
+#include <iostream>
+
+void prep();
+void myinit();
+
+int main()
+{
+ prep();
+ myinit();
+
+ int myints[] = {32,71,12,45,26,80,53,33};
+ std::vector<int> myvector (myints, myints+8); // 32 71 12 45 26 80 53 33
+
+ // using default comparison (operator <):
+ std::sort (myvector.begin(), myvector.begin()+4); //(12 32 45 71)26 80 53 33
+
+ for (std::vector<int>::iterator it=myvector.begin(); it!=myvector.end(); ++it)
+ printf("%i\n",*it);
+ printf("hello\n");
+
+// printf("reent struct size: %d bytes\n",sizeof(struct _reent));
+ // printf("reent pointer : 0x%08x\n",_impure_ptr);
+ //printf("reent pointer : 0x%08x\n",_impure_ptr);
+ std::cout << "bye bye" << std::endl;
+ printf("hello\n");
+}
+
// constructing vectors
+/*
#include <iostream>
#include <vector>
#include <cstring>
@@ -8,6 +39,7 @@
int main()
{
+ std::cout << "hi" << std::endl;
_REENT_INIT_PTR(_impure_ptr);
@@ -32,3 +64,4 @@ int main()
return 0;
}
+*/