Skip to content

Instantly share code, notes, and snippets.

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 acassis/504e86d992a2fc459784c6284aa90e53 to your computer and use it in GitHub Desktop.
Save acassis/504e86d992a2fc459784c6284aa90e53 to your computer and use it in GitHub Desktop.
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