how to load an image using sdl from memory (c++)
i have an image inside a std::vector <std::string> variable (i downloaded the image from a website using winhttp i successfully managed to write to file and displayed but now i want to display it directly from memory) how can i load it 
i have tried this but it does not work

    SDL_Surface *load_image(char * buff,int size) 
    {
	SDL_RWops *rw = SDL_RWFromMem(buff,size );
	SDL_Surface *temp = IMG_Load_RW(rw, 1);
 

	if (temp == NULL) 
	{
		printf("IMG_Load_RW: %s\n", IMG_GetError());
		system("pause");
		exit(1);
	}
 
	//Convert the image to optimal display format
	SDL_Surface *myimage;
	image = SDL_DisplayFormat(temp);
 
	//Free the temporary surface
	SDL_FreeSurface(temp);
 
	//Return our loaded image
	return myimage;

     } 


    std::vector <std::string> buffer = c.data();
    std::string str_buffer =buffer[0];

    for( size_t i =1;i<buffer.size();++i)
    {
     str_buffer+=buffer[i];


      }; 

      image = load_image(const_cast<char*>(str_buffer.c_str()),str_buffer.length()+1);


how to load an image using sdl from memory (c++)
===

i have an image inside a std::vector <std::string> variable (i downloaded the image from a website using winhttp i successfully managed to write to file and displayed but now i want to display it directly from memory) how can i load it 
i have tried this but it does not work

    SDL_Surface *load_image(char * buff,int size) 
    {
	SDL_RWops *rw = SDL_RWFromMem(buff,size );
	SDL_Surface *temp = IMG_Load_RW(rw, 1);
 

	if (temp == NULL) 
	{
		printf("IMG_Load_RW: %s\n", IMG_GetError());
		system("pause");
		exit(1);
	}
 
	//Convert the image to optimal display format
	SDL_Surface *myimage;
	image = SDL_DisplayFormat(temp);
 
	//Free the temporary surface
	SDL_FreeSurface(temp);
 
	//Return our loaded image
	return myimage;

     } 


    std::vector <std::string> buffer = c.data();
    std::string str_buffer =buffer[0];

    for( size_t i =1;i<buffer.size();++i)
    {
     str_buffer+=buffer[i];


      }; 

      image = load_image(const_cast<char*>(str_buffer.c_str()),str_buffer.length()+1);

