Polynomials

I have a task to create class of Polynomials. I need to create a constructor in following form:

Polynomial::Polynomial(char* poly)

Also, I have one condition in my task. I can only use STRING from standard library.

If someone can send me one part of code, I would be grateful.

Thanks in advance!
The constructor will look like this:

1
2
3
4
5
6
Polynomial::Polynomial(char* poly)
{
  // Here, examine the char array passed in and generate the polynomial coefficents from it


}
Thanks for the advice. My idea is to get the length of the string and then using a loop go through the string and extract coefficients and exponents into two different arrays. Am I on the right path?

Use vectors rather than arrays, but that sounds reasonable. Be sure to enforce the accept format of the input string.
I would use vectors, but I forgot to say that vectors are also forbidden.

One more question:

Also, I have to create a function for polynomials division. When I divide with polynomial of 1st degree, I thought to do it with Horner's method, but I have problem when I divide with polynomial of 2nd or higher degree. Can someone give me just a little hint?
Topic archived. No new replies allowed.