Let's say I've got the following function. It outputs an array that represents a sine wave for two periods. Is there a way I can ouput it to my screen so that it makes graph? I've used GNUplot but I was wondering if there was a way I could do it dirrectly in C++. Could this also be done in C?
Code:#include <iostream> #include <math.h> using namespace std; int main() { double y[200]; int i; for (i=0; i<200; i++) y[i]=sin(2*M_PI*(i)/100); for (i=0; i<200; i++) cout<< y[i]<<endl; return 0; }