#include <iostream>
// The header file from single_include
#include "tabulate.hpp"
using namespace tabulate;
int main() {
Table table;
table.add_row({"cell"});
auto [rows, cols] = table.shape();
std::cout << rows << " " << cols << std::endl;
}
In my environment it prints "8 3".
$ g++ test_tabulate.cpp -o test
$ ./test
8 3
I don't think that matters but I use g++ (GCC) 12.2.0 on CentOS 7
I didn't go deep into details but I believe it prints some numbers that depend on the size of the buffer that is created in TableInternal::shape() method.
Is it possible to fix/add a method that would return an actual number of rows and columns that were added to the table?
Hi!
I expect this code to print "1 1"
In my environment it prints "8 3".
I don't think that matters but I use
g++ (GCC) 12.2.0
onCentOS 7
I didn't go deep into details but I believe it prints some numbers that depend on the size of the buffer that is created in
TableInternal::shape()
method.Is it possible to fix/add a method that would return an actual number of rows and columns that were added to the table?
This worked for me.