我得到:C:\Documents and Settings\ppp\Pulpit\Zadanie3Infix\main.cpp|72|error: conversion from 'std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >*' to non-scalar type 'std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >' requested|
我不知道为什么。该函数假设返回字符串向量并且确实如此,我使用了所有这些 * & 并且它不起作用。请纠正我,以便它返回这个向量。
它的工作原理就像 s = "(2+23)" 它将返回它将返回带有标记的向量。
vector<string> split(string s){
vector<string>* v = new vector<string>();
int i = 0; bool b;string el = "";
while(i < s.size()){
if(isNotNumber(s.at(i))){
el = s.at(i);
v->push_back(el);
cout<<el<<" to operator"<<endl;
el = "";
i++;
}else{
while( i <s.size() && !isNotNumber(s.at(i))){//LENIWE WYLICZANIE !!!
el = el + s.at(i);
cout<<s.at(i)<<" to liczba"<<endl;
i++;
}
v->push_back(el);
el = "";
}
}
cout<<"PO while"<<endl;
for(int i = 0; i < v->size();i++){
cout<<v->at(i)<<endl;
}
return v;
}
那怎么样
stack<string>* stack = new stack<string>();
堆栈前的类型说明符;//////////////