Creating a Cubemap in DX11

I have noticed there isn't a lot of reference for this on the internet, so here is how to create a cubemap in DirectX11.

 // Load all individual images into CPU memory.
 LoadedImageData images[6];
 bool loadedImages = LoadCubeFaces(&images[0]);

 //Using DXGI_FORMAT_R8G8B8A8_UNORM (28) as an example.
 DXGI_FORMAT format = DXGI_FORMAT_R8G8B8A8_UNORM;

 //Ensure we have the images we want to put in the cube map.
 if (loadedImages)
 {
	 //D3DObjects to create
	 ID3D11Texture2D* cubeTexture = NULL;
	 ID3D11ShaderResourceView* shaderResourceView = NULL;

	 //Description of each face
	 D3D11_TEXTURE2D_DESC texDesc;
	 texDesc.Width = width;
	 texDesc.Height = height;
	 texDesc.MipLevels = 1;
	 texDesc.ArraySize = 6;
	 texDesc.Format = format;
	 texDesc.CPUAccessFlags = 0;
	 texDesc.SampleDesc.Count = 1;
	 texDesc.SampleDesc.Quality = 0;
	 texDesc.Usage = D3D11_USAGE_DEFAULT;
	 texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
	 texDesc.CPUAccessFlags = 0;
	 texDesc.MiscFlags = D3D11_RESOURCE_MISC_TEXTURECUBE;

	 //The Shader Resource view description
	 D3D11_SHADER_RESOURCE_VIEW_DESC SMViewDesc;
	 SMViewDesc.Format = texDesc.Format;
	 SMViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
	 SMViewDesc.TextureCube.MipLevels = texDesc.MipLevels;
	 SMViewDesc.TextureCube.MostDetailedMip = 0;

	 //Array to fill which we will use to point D3D at our loaded CPU images.
	 D3D11_SUBRESOURCE_DATA pData[6];
	 for (int cubeMapFaceIndex = 0; cubeMapFaceIndex < 6; cubeMapFaceIndex++)
	 {
		 //Pointer to the pixel data
		 pData[cubeMapFaceIndex].pSysMem = images[i].pixels; 
		 //Line width in bytes
		 pData[cubeMapFaceIndex].SysMemPitch = images[i].rowPitch; 
		 // This is only used for 3d textures.
		 pData[cubeMapFaceIndex].SysMemSlicePitch = 0;
	 }

	 //Create the Texture Resource
	 HRESULT hr = _directx->GetDevice()->CreateTexture2D(&texDesc, &pData[0], &cubeTexture);
	 if (hr != S_OK)
	 {
		 return false;
	 }

	 //If we have created the texture resource for the six faces 
	 //we create the Shader Resource View to use in our shaders.
	 hr = _directx->GetDevice()->CreateShaderResourceView(m_cubeTexture, &SMViewDesc, &shaderResourceView);
	 if (hr != S_OK)
	 {
		 return false;
	 }

 }