C++

>c++

Attached: IMG_20180424_081001.jpg (1120x1493, 804K)

What's wrong? Now that you've written the function, it's just as easy as calling `.split('|')` would be in JS. And they tell you how to write that function.

C++ is rarely an appropriate language for text wrangling, though.

javascript master race here. Don't mind me.

string = "Name|Address|Phone";
splatString = string.split("|");

You can also use getline

>not coding your own standard library

best OS!

>windows
>wintoddler doesn't even know how to take a screenshot

All i need to know how to take your mom
#rekt #btfo

FUCKIN REKT!!!!!

Hmmm, what does this button do

Attached: print-screen-2.jpg (600x268, 50K)

fuck ur mom

n

>retards dont understands that is my work pc and i cant post from it

How do you even know how to eat with such stupidity?

Cтoп. Hy кoмy ты пиздишь a?

>How do you even know how to eat with such stupidity?
perhaps if you spent more time working rather than phone posting you might not be struggling with these basic concepts so much.

>using streams to split a string

>global scope using namespace std
>split doesn't return the vector it makes, takes a shitty reference instead
>no foreach loop
>'\n' instead of endl
>main doesn't return
>Emacs
Slavs should be nuked.

>having a job
LOL

>posting company code

Attached: that's a paddlin'.jpg (500x361, 19K)

It's from a book

>being a neet virgin faggot
Lol

I knew Jow Forums was full of retards but didn't know it was that bad

Who cares.

not siding with the other guys but just want to say NEET life is best life.

>.split
No. Implement split as is demonstrated in the example.

C is better

Attached: screenshot.png (692x459, 30K)

>reinventing the wheel

>not thread-safe

no thanks

>Not text wrangling with python scripts which then are finally actually processed by the C++ program
Right tools for the right job bitch

awk 'BEGIN{RS="|"} {print}'

>string::size_type instead of size_t

string::size_type is the right type. they don't need to be equivalent to size_t and you could even have string::size_type != vector::size_type.

>Trusting anyone else's code but your own
Go back to Python, normie

#include
#include
#include
using namespace std;
// ^^^ Fuck any retarded brainlet who thinks this is bad.
vector split(string str, char delim) {
vector vec;
char const *cstr = str.c_str(), *back = cstr;
for (int ch; (ch = *cstr); ++cstr) if (delim == ch) {
vec.emplace_back(back, cstr - back);
back = cstr + 1;
}
vec.emplace_back(back, cstr - back);
return vec;
}
int main() {
for (string s: split("Account Name|Address 1|Address 2|City", '|'))
cout

#include
#include
using namespace std;
vector split(string s, char d) {
vector v {""};
for (auto c: s) if (c == d) v.emplace_back();
else v.back().push_back(c);
return v;
}

>using python instead of based Powershell

HAHAHHAHA go back to russia dumbshit

QString str = "Account Name|Address 1|Address 2|City";
QStringList list = str.split('|');

My nig

My printer is out of ink

>What is QString
>What is boost::algorithm::string::split

Well that's kind of what std::istringstream is for...

Use substr faggot

This.

Cyka blyat

'course, this code is really incorrect.

Hint: what's the lifetime of `str`?

Moral of the story -- don't use c_str unless you're interfacing with a library that makes you use legacy strings. std::string is better, use it.