If I understood you correctly, you want to make a 40x40 tiled map with sprites, therefore this the way to go:
should i create different sprites for each tile (talking about the same graphics tiles) with different positions??
Of course, there are other ways to make a tilled map, such as, using sf::VertexArrays, not sprites, but they are a bit tricky to use.
So if you are just starting out with SFML, the sprites should be enough.
If you wanted to ask "Why the second option isn't good?", it isn't good because you always need to keep rendering separated from rest of the code, not to mix anything with it. Doing so is a bad code design and almost always causes trouble in more serious projects. It should do only:
// Positions, sizes, colors, textures, ect... are always updated before rendering:
void Render()
{
window.clear(sf::Color::Black);
window.draw(sprite1); // You can also apply transformations using "window.draw(sprite1, transformations)", but that is another story :)
window.draw(sprite2);
// Or how many things you want to draw.
window.display();
}
Also note that this is too a valid approach:
// Let's say we have a class (or classes) called World that has function for rendering.
// positions, textures, ect... are updated somewhere.
void World::render(sf::RenderWindow& window) // Passing a sf::RenderWindow by reference (&) is very important!
{
window.draw(sprite1);
window.draw(sprite2);
// ect.
}
void render()
{
window.clear();
mWorld.render(window); // mWorld is an object of World class;
window.display()
}