I've spent the past two hours trying to debug this shitty program I wrote only to finally figure out the issue. For some stupid reason, I forgot to increment the one variable keeping track of the size of an array of strings. Am I an idiot Jow Forums? (faggot?) you decide
>Can't write a for loop without fucking up user, I just can't even
Daniel Peterson
Making a personal blog post about your homework is even more retarded OP.,
James Howard
>Electron
Get the fuck out nigger
Jeremiah Barnes
that's not Code you dumb fucking bitch.
Ayden Sullivan
Look closer, retard.
Easton Myers
donovan pls
Ryder Sanders
I can't stand IDEs, they just look so bloated.
Ethan Phillips
If you're tripping over simple stuff, it's a good sign that you need to take a break. Come back when your stress levels are lower and mistakes won't kite you around like this.
Use the std algorithms instead. In your case, that would mean something like auto mod_index = std::count_if(mod_list.begin(), mod_list.end(), [](auto c) { return c == '@'; });
It's also better since it works as documentation of your intent.
Matthew Hughes
Not using a decent IDE like VSCode or Atom
Kayden Miller
That's what you get for using C++ faggot.
Angel Nguyen
Horrible code, what the fuck are you doing? Is this ironic? std::vector is what you want. And use a range-based or at LEAST an iterator-based for loop. Don't use naked new you WILL leak data at one point.
So much this, OP sit down and read a fucking BOOK
Angel Fisher
to expand on this , you can complement the std ones with your own custom algos. From your source, I guess you are trying to split a string into an array of strings by a special character. Instead of programming like a monkey, you could solve the general problem instead: template InputIt copy_while(InputIt first, InputIt last, OutputIt d_first, UnaryPredicate pred) { while (first != last) { if (pred(*first)) { *d_first++ = *first++; } else break; } return first; }
template std::vector split_by(const T &t, U u) { std::vector v; auto next = t.begin(); while (next != t.end()) { T e; next = copy_while(next, t.end(), std::back_inserter(e), [=](auto c){ return u != c; }); v.emplace_back(e); } return v; }
Now you can split generic containers by a generic value type into a vector of the original container type.
Andrew Taylor
that should be else { first++; break; }
Jackson Taylor
I did the same thing. Wrote a serialiser to save some workbook data, but every time it loaded it would lose two cells of data off the end.
Realised I was using the wrong index incrementer to grab the data, causing it to skip over the load data at the end. Felt like a real idiot for that one.
Kayden Moore
If he's trying to split strings like that, he should be using library
Owen Hill
That's why you're unemployed
Kayden Ramirez
>Microsoft Visual Studio >sepples >using namespace std yes you are