Created
June 7, 2017 14:38
-
-
Save acassis/504e86d992a2fc459784c6284aa90e53 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 0bca5af07cefe043e5b8dfa477814982fd941ca4 Mon Sep 17 00:00:00 2001 | |
From: Alan Carvalho de Assis <acassis@gmail.com> | |
Date: Wed, 7 Jun 2017 11:35:20 -0300 | |
Subject: [PATCH] Modify helloxx to test sstream | |
--- | |
examples/helloxx/helloxx_main.cxx | 8 +++++++- | |
1 file changed, 7 insertions(+), 1 deletion(-) | |
diff --git a/examples/helloxx/helloxx_main.cxx b/examples/helloxx/helloxx_main.cxx | |
index a5279a7..88f0f54 100644 | |
--- a/examples/helloxx/helloxx_main.cxx | |
+++ b/examples/helloxx/helloxx_main.cxx | |
@@ -43,6 +43,10 @@ | |
#include <debug.h> | |
#include <nuttx/init.h> | |
+#include <nuttx/arch.h> | |
+ | |
+#include <iostream> | |
+#include <sstream> | |
#include "platform/cxxinitialize.h" | |
@@ -78,7 +82,9 @@ class CHelloWorld | |
public: | |
CHelloWorld(void) : mSecret(42) | |
{ | |
- cxxinfo("Constructor: mSecret=%d\n", mSecret); | |
+ std::ostringstream oss; | |
+ oss << "Hello World! " << mSecret << "\n"; | |
+ std::cout << oss.str(); | |
} | |
~CHelloWorld(void) | |
-- | |
2.7.4 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment