I get: 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|
and i don't know why. The function suppose to return vector of strings and it does, i used all of these * & and it does not work. Please correct me so it will return this vector.
it works like that s = "(2+23)" it will return it will return vector with tokens.
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;
}
and what about that
stack<string>* stack = new stack<string>();
type specifier before stack ;////////////////
vector<string> vand return it by value. C++ is not Java so stop usingnewon everything.