Message from C, C++ talks

June 2019

— Or should i paste code here

— Pastebin if it's long

— 32 lines

— BTW, they fixed this in C++17?

— 

'''class Solution {
public:
ListNode* reverseBetween(ListNode* head, int m, int n) {
ListNode *cur=head,*prev=head,*pre=head,*post=head;


for(int i=0;i<m-2;i++)
{
prev=prev->next;
}
pre=prev->next;
cur=pre->next;

for(int i=m;i<n;i++)
{ if(post!=NULL)
{
post=cur->next;}
cur->next=pre;
pre=cur;
cur=post;
}
prev->next=pre;

for(int i=m;i<n;i++)
{
pre=pre->next;
}

pre->next=cur;
return head;

} };'''

— C++ 17.... Means..?

— Line 20: Char 4: runtime error: member access within null pointer of type 'struct ListNode' (solution.cpp)

Message permanent page

— User Shyam has 1/3 warnings; be careful!
The latest warn was because:
run it

— People can’t run code these days 😕

— This isn't all your code tho

— Opps

— Actually this was a question from leetcode

— Does it delete links to online compilers and pastebin too? :)

— Yup

— Nah, they're trying write it on mobile 😂