Message from C, C++ talks

June 2019

— > I've heard a lot about that is better to use old C90 standard. Correct me if I'm wrong.
well you're very very very wrong. yes there are these people who find it cool to hate on new features, but you'll just have to learn to ignore those. also if you're looking for anything game related C++ will likely be better (and for most things C++ would be better, so idk why you want to learn C, which is better than C++ only is select few cases). and for ide just use whatever suits you, CLion will work, so will vim (but some plug-ins would be handy)

Message permanent page

— Yeah, I want to learn C. Then I realize how quickly something could go wrong with code that doesn't look problematic. It's not such a safe language, unless you learn from your mistakes and don't repeat them. If you can get through C, you can probably make it through most other things, right?

Message permanent page

— Yes

— Well, languages are different, they use different concepts on the level of the language (classes, functional objects, coroutines, lazy evaluation). You can use some of such concepts in C as well, but it would be much harder as you need to implement them and be consistent, because there's no compiler to help you with this (because it cares only about C syntax).

Usually, if you know C well, but know only C.. then you know only C.

Message permanent page

— 

Can anyone help me to remove this error "runtime error: member access within null pointer of type 'struct ListNode'"

— I think the error message is very specific, but without code snippet, we can't help

— Can i pm?

— 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;

} };'''

Message permanent page

— 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