Hello,
I just started SFML and wanted to do a class called Spritesheet and a class called Hero which contained an instance of Spritesheet. The class spritesheet contains all the sprites of the hero character so I can quickly fill a vector of sf::Sprite that the class Hero will be using to move, etc. But I encountered a problem : I try to use arrays in functions and it doesn't work I don't know why.

I got a function setVectorSprite in my Spritesheet class that takes 2 int arrays of 3 elements, and I wondered how I can give the array to the function (since if I only give the name of the array it would only mean the address of the first element). I give you the full code IN CASE the problem doesn't come from there.

Here's the full code :
Code:
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <string>
#include <vector>

#define SIZE 3

sf::Event event;

class Spritesheet
{
    public:
    sf::Sprite mainSprite;
    sf::Texture textureHero[SIZE];
    int vectorPX[SIZE], vectorPY[SIZE];
    void setVectorSprite(int vectorX[SIZE], int vectorY[SIZE]);
    void setFileName(std::string filename);
    std::string & getFileName();
    std::vector<sf::Sprite> & getVectorSprite();
    sf::Sprite & getVectorSpriteJ(int j);

    private:
    std::string filenameS;
    std::vector<sf::Sprite> vectorSprite;


};




class Hero
{
public:
    Spritesheet spriteSheetHero;
    void setHealth(int health);
    int & getlastX();
    int & getlastY();
    void setPos(int posX, int posY);

private:
    int healthH;
    int lastposX, lastposY;
    int curX, curY;


};



int main()
{

    sf::RenderWindow window(sf::VideoMode(800,600), "SFML Char test");
    // window.setFramerateLimit(10);
    while(window.isOpen())
    {
        sf::Clock clock;
        sf::Time elapse = clock.getElapsedTime();
        while(window.pollEvent(event))
        {
            switch(event.type)
            {
                case sf::Event::Closed:
                window.close();
                break;

                default:
                break;
            }

        }
        window.clear(sf::Color::Blue);
        // setting the hero
        Hero hero;
        hero.setHealth(100);
        hero.spriteSheetHero.setFileName("spritesheet.png");
        int testX[3] = { 14, 49, 78 };
        int testY[3] = { 9, 9, 9 };
        hero.spriteSheetHero.setVectorSprite(testX, testY );
        hero.spriteSheetHero.mainSprite.setTexture(*((hero.spriteSheetHero.getVectorSpriteJ(2)).getTexture()));

        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
        {
            clock.restart();
            hero.spriteSheetHero.mainSprite.setTexture(*((hero.spriteSheetHero.getVectorSpriteJ(1)).getTexture()));
            hero.spriteSheetHero.mainSprite.move(-1, 0);
            /*if(elapse == 300)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            if(elapse == 600)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            clock.restart();*/
        }
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
        {
            clock.restart();
            hero.spriteSheetHero.mainSprite.setTexture(*((hero.spriteSheetHero.getVectorSpriteJ(1)).getTexture()));
            hero.spriteSheetHero.mainSprite.rotate(180);
            hero.spriteSheetHero.mainSprite.move(1, 0);
            /*if(elapse == 300)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            if(elapse == 600)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            clock.restart();*/
        }
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
        {
            clock.restart();
            hero.spriteSheetHero.mainSprite.setTexture(*((hero.spriteSheetHero.getVectorSpriteJ(0)).getTexture()));
            hero.spriteSheetHero.mainSprite.move(0, -1);
            /*if(elapse == 300)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            if(elapse == 600)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            clock.restart();*/
        }
        if(sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
        {
            clock.restart();
            hero.spriteSheetHero.mainSprite.setTexture(*(((hero.spriteSheetHero.getVectorSpriteJ(2)).getTexture())));
            hero.spriteSheetHero.mainSprite.move(0, 1);
            /*if(elapse == 300)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            if(elapse == 600)
            {
                hero.spriteSheetHero.mainSprite.setTexture((hero.spriteSheetHero.getVectorSpriteJ()).getTexture());
            }
            clock.restart();*/
        }
        hero.setPos(100,100);
        window.draw(hero.spriteSheetHero.mainSprite);

        window.display();
    }
    return 0;

}

void Hero::setHealth(int health)
{
    healthH = health;
}

void Spritesheet::setVectorSprite(int vectorX[3], int vectorY[3])
{
    for(int i = 0; i < SIZE; i++)
    {
        vectorPX[i] = vectorX[i];
        vectorPY[i] = vectorY[i];
        textureHero[i].loadFromFile(getFileName(), sf::IntRect(vectorPX[i] ,vectorPY[i] ,18 ,26 ));
        getVectorSpriteJ(i).setTexture(textureHero[i]);
    }
}

void Spritesheet::setFileName(std::string filename)
{
    filenameS = filename;
}

std::vector<sf::Sprite> & Spritesheet::getVectorSprite()
{
    return vectorSprite;
}

int & Hero::getlastX()
{
    return lastposX;
}

int & Hero::getlastY()
{
    return lastposY;
}

void Hero::setPos(int posX, int posY)
{
    curX = posX;
    curY = posY;
    spriteSheetHero.mainSprite.setPosition(curX, curY);
}

sf::Sprite & Spritesheet::getVectorSpriteJ(int j)
{
    return vectorSprite[j];
}
std::string & Spritesheet::getFileName()
{
    return filenameS;
}
Thanks you in advance :)
PS: No the problem doesn't come from the loading of the file (otherwise it displays one error in console, I tried) :)