新手求教一个关于字符串分割的有关问题

新手求教一个关于字符串分割的问题
目前有一段字符串它可能是以下几种形式中的一种:
(A+B)*c
A+(B-C)
A*(B+C)/D

无论它是哪种形式,我想写一个方法,以括号为分割符,把这个字符串分割成几个部分,并且知道括号内的内容是第几部分。
举个例子来说,第三种形式的字符串。方法的运行结果会输出 "[A*] [B+C] [ /D] 其中括号内的内容为第 2 部分"

像这样的方法应该怎么写?刚接触C++没多久,实在是没思路了。先谢过各位大拿了。

------解决方案--------------------
C/C++ code
#include<iostream> 
#include <string>
using namespace std; 


int main() 
{    
    string str = "A+(B*c)/d*e";
    int beg = str.find_first_of('(', 0);
    int end = str.find_first_of(')', 0);
    string sub[3];
    sub[0] = str.substr(0, beg);
    sub[1] = str.substr(beg + 1, end - beg - 1);
    sub[2] = str.substr(end + 1, str.size() - end);
    for(string::size_type i = 0; i < 3; ++i)
    {
        sub[i].insert(0, "[");
        sub[i].append("]");
        cout<<sub[i]<<endl;
    }
    int part = (beg == 0) ? 1 : ((end == str.size() - 1) ? 3 : 2);
    cout<<"() is at part "<<part<<endl;
    return 0; 
}

------解决方案--------------------
C/C++ code
char s[]="A*(B+C)/D";
printf("%s",strtok(s,"()");// A*
printf("%s",strtok(NULL,"()");// B+C
printf("%s",strtok(NULL,"()");// /D

------解决方案--------------------
C/C++ code

.h
#include <string>
#include <iostream>

class SplitStr
{
public:
    SplitStr(std::string s):strVl(s){}
    SplitStr(const SplitStr&);
    void split();
    void print();
private:
    std::string strVl;
    std::string strVes[3];
};

SplitStr::SplitStr(const SplitStr& other)
{
    strVl = other.strVl;
}

void SplitStr::split()
{
    std::string::iterator iter = strVl.begin();
    strVes[0].push_back('[');
    while(*iter != '(')
    {
        strVes[0].push_back(*iter);
        iter++;
    }
    strVes[0].push_back(']');
    strVes[1].push_back('[');
    iter++;
    while(*iter != ')')
    {
        strVes[1].push_back(*iter);
        iter++;
    }
    strVes[1].push_back(']');
    strVes[2].push_back('[');
    iter++;
    while(iter != strVl.end())
    {
        strVes[2].push_back(*iter);
        iter++;
    }
    strVes[2].push_back(']');
}

void SplitStr::print()
{
    for(int i = 0;i < 3;i++)
    {
        std::cout << strVes[i] << std::endl;
    }
}