This is an automated email from the ASF dual-hosted git repository.

colinlee pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/tsfile.git


The following commit(s) were added to refs/heads/develop by this push:
     new 69ff73d7 fix compile in demo_cpp. (#432)
69ff73d7 is described below

commit 69ff73d72c5a81f90b109cfe3b776f36c4b81e8a
Author: Colin Lee <[email protected]>
AuthorDate: Fri Mar 7 17:26:28 2025 +0800

    fix compile in demo_cpp. (#432)
---
 cpp/examples/cpp_examples/demo_read.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cpp/examples/cpp_examples/demo_read.cpp 
b/cpp/examples/cpp_examples/demo_read.cpp
index 667fbfa1..1b5c982c 100644
--- a/cpp/examples/cpp_examples/demo_read.cpp
+++ b/cpp/examples/cpp_examples/demo_read.cpp
@@ -26,7 +26,6 @@
 using namespace storage;
 
 int demo_read() {
-
     int code = 0;
     libtsfile_init();
     std::string table_name = "table1";
@@ -54,8 +53,8 @@ int demo_read() {
     for (int i = 1; i <= column_num; i++) {
         std::cout << "column name: " << metadata->get_column_name(i)
                   << std::endl;
-        std::cout << "column type: " << 
std::to_string(metadata->get_column_type(i))
-                  << std::endl;
+        std::cout << "column type: "
+                  << std::to_string(metadata->get_column_type(i)) << std::endl;
     }
 
     // Check and get next data.
@@ -84,7 +83,8 @@ int demo_read() {
                         std::cout << ret->get_value<double>(i) << std::endl;
                         break;
                     case common::STRING:
-                        std::cout << *(ret->get_value<common::String*>(i))
+                        std::cout << ret->get_value<common::String*>(i)
+                                         ->to_std_string()
                                   << std::endl;
                         break;
                     default:;

Reply via email to