How to use C++ code in Arduino ide

thanks a lot, I did that, I have another question please, can I deal with file (.txt) ? my function read the input from file, the function in (.cpp file) be like this
void dosomething()
{
ifstream fin("brb.txt"); //file to be read
ofstream fcom("c9999999omjp.txt"); // the output of function putting in this file

// rest of the function
}
and the output of this fb = esp_camera_fb_get(); after printing be like this :
126,120,255,232,123,...
how can I sent this output to the function dosomething() ? can you help please?