I have been pretty successful in understanding the implementation of drawing charts in and exporting data to excel. Now I am trying to implement Excel Worksheet functions in C++. Here is the working structure of it:

double wf = xl->Application->WorksheetFunction->STDEV(1,2,3,4,5);

However, I have not been successful in passing an array or vector of doubles to STDEV. E.g. If I have an array: arr[5] = {1,2,3,4,5};
How do I implement:

double wf2 = xl->Application->WorksheetFunction->STDEV(arr);

The kind of errors that I am getting currently relates to passing of the data type into STDEV. Is there a way to convert my arr to const _variant_t type? As this is the type which is being accepted as argument to function STDEV.

Any leads?