Python Study, Pycharm first setting
At first, you have to register python compiler,
Setting menu is here ...
Preference -> Project interpreter
or
File -> Default settings... -> project interpreter
And then, Add(+) python interpreter path and click apply or ok button
Setting menu is here ...
Preference -> Project interpreter
or
File -> Default settings... -> project interpreter
And then, Add(+) python interpreter path and click apply or ok button
C,C++, string split example source code (stringstream, getline functions)
#include < iostream >
#include < string >
#include < sstream >
using namespace std;
vector< string> str_split(const string &s, char delim)
{
vector< string> elems;
stringstream ss(s);
string item;
while (getline(ss, item, delim)) {
elems.push_back(item);
}
return elems;
}
int main()
{
vector< string> str = str_split( "123,456", ',');
for(int i=0; i< str.size(); ++i)
{
printf("%s\n", str[i].c_str() );
}
}
Labels:
C
C++
string functions
Total
Subscribe to:
Posts (Atom)






