Hello, I was wondering it it's possible to change my textfile to an arrray.

For example this is my text file: 4x3 + 5x^2 + 3x + 2

I want to get the number of coefficients and the coefficients. That would look something like this

Code:
double [number of coef]= {2,3,5,4}
Is this possible? I have a hard time figuring out a code for this