plot a 2d line

Hi, I'm new to c++, and now I need to plot a line according to several points(x,y). Is there any easy library i can use? It doesn't need to be fancy, just need to get the line.

Thanks!!
You could use a graphical library such as SFML or SDL to do this fairly simple. If you really wanted console you could use this for windows http://msdn.microsoft.com/en-us/library/ms686025%28VS.85%29.aspx
SFML 2.1:

1
2
3
4
5
6
7
8
9
10
11
sf::Vertex line[]=
{
    sf::Vertex(sf::Vector2f(50,50));        // starting point
    sf::Vertex(sf::Vector2f(200,200));    // ending point
};

//. . .

// somewhere in the game loop
window.draw(line,2,sf::Lines);


More about shapes on http://www.sfml-dev.org/tutorials/2.1/graphics-shape.php.
Topic archived. No new replies allowed.