foo.cc: In function ‘int strtoint(std::string)’:
foo.cc:5:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
5 | for(int i=0;i<s.size();i++)
| ~^~~~~~~~~
foo.cc: In function ‘int main()’:
foo.cc:16:22: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
16 | for(int i=0;i<=s.size();i++){
| ~^~~~~~~~~~
foo.cc:19:28: warning: ‘tmp’ may be used uninitialized [-Wmaybe-uninitialized]
19 | tmp*=strtoint(ts);
| ~~~^~~~~~~~~~~~~~
foo.cc:13:19: note: ‘tmp’ was declared here
13 | int ans=0,tmp;
| ^~~