sfml draw line

#include <SFML/Graphics.hpp>

int main()
{
    // Create a window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Line");

    // Create a line
    sf::Vertex line[] = {
        sf::Vertex(sf::Vector2f(100.f, 100.f)),
        sf::Vertex(sf::Vector2f(400.f, 400.f))
    };

    // Main loop
    while (window.isOpen())
    {
        // Process events
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        // Clear the window
        window.clear();

        // Draw the line
        window.draw(line, 2, sf::Lines);

        // Display the contents of the window
        window.display();
    }

    return 0;
}