Guys, I hope you can help me. I need to do a program, in which I create the sin function, but that's not the point... How can I tabulate the results in a .txt file? I mean, how do I create a table that contains my results?
Thanks Aaron for help! I haven't tested the code, but yes, I'm familiar with how we can write inside a .txt file. But, could you write a code that builds a table, in which column 1 is for one type of data, the column 2 for a different type and the 3rd for another type?
I mean, how can we tabulate data? o.O
** What I'm asked to do is a program that gets the results of sin(x) and cos(x) if x is between -2*PI and 2*PI with a step of 0,001. That means:
Yes, I want that. But now that I just tested the code Aaron Vienneau provided, I realize that it's easier if we don't include some kind of bars that separate the results. But is it possible to separate the results in a tabular form and can you check the code I left in my previous answer?
As plain text files cannot contain graphics of any kind. But this would be terribly time-consuming for very little benefit. Not to mention, it would make reading the file back into a program, an absolute nightmare. Alternatively, you could look into LibXL which apperantly is a C++ library that allows you to read and write .xlsx files; which are, by nature, tabulated.
Thanks for your help Aaron Vienneau! But I figured a code that can tabulate some results a little bit easier, using .fill() stringstream ss .str() and .precision