Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Activity for Lundinâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #285462 |
@#54706 Essentially; if there is no rule against it people will post endless floods of copy/paste homework dumps with no effort made. This is already a massive problem at SO and they have rules against it - they even suspend people who keep posting such crap for 6 months. We should only help people w... (more) |
— | about 3 years ago |
Comment | Post #285396 |
The beginner tour: https://meta.codidact.com/tour (more) |
— | about 3 years ago |
Comment | Post #285398 |
If you intent to post in a specific group or if you know that your network contains mainly of "x" technology developers, then naturally use a post about "x". In your case maybe something about .NET? Though I'm not sure if we got many good posts about that specifically? (more) |
— | about 3 years ago |
Edit | Post #285462 |
Post edited: |
— | about 3 years ago |
Edit | Post #285462 | Initial revision | — | about 3 years ago |
Answer | — |
A: How to best ask about algorithmic problems This question was of very poor quality and should have been closed. I closed it but someone disagreed, for reasons unknown. I'm not sure if it's an actual algorithm question or just a request for free code. C strings are very specific to that programming language and I'm not sure if it's even meaning... (more) |
— | about 3 years ago |
Comment | Post #285399 |
One of the greatest benefits ought to be community-driven open source. So if we want to change something, we can. No need to scrape and bow for some non-responsive private company. (more) |
— | about 3 years ago |
Comment | Post #285351 |
I don't think this is correct - see the quote in my posted answer. Also the memory returned by malloc does not have a declared or effective type, so normal array out of bounds rules do not apply, at least not until it gets an effective type. (more) |
— | over 3 years ago |
Comment | Post #285298 |
Any variable dealing with `EOF` must be `int`, not `char`. (more) |
— | over 3 years ago |
Comment | Post #285218 |
@#54706 I don't think such an answer will be of particular high quality. This is best answered by studying the string handling chapter in a C book, then make an attempt to solve the problem and ask specific questions about the code when stuck. (more) |
— | over 3 years ago |
Comment | Post #285259 |
I now proposed to add code golf as off-topic here: https://software.codidact.com/posts/278648/285266#answer-285266 (more) |
— | over 3 years ago |
Edit | Post #285266 | Initial revision | — | over 3 years ago |
Answer | — |
A: Community feedback: What type of questions can I ask here? I propose that we add the following: > Off-topic > - Questions about code golf, programming puzzles and challenges. Please use Code Golf instead. (more) |
— | over 3 years ago |
Comment | Post #285259 |
@#54706 It's always good to have a meta thread pointing out that something is off-topic, since I just now noticed that code golf and puzzles/challenges aren't covered by our on-topic page. https://software.codidact.com/help/on-topic (more) |
— | over 3 years ago |
Comment | Post #285259 |
If one checks history, the exact data is posted. The question here was posted at 2020-08-14 but Code Golf was launched 2020-11-13. I think everyone agrees that code challenges should be posted at Code Golf and that they are off-topic here. (more) |
— | over 3 years ago |
Comment | Post #285243 |
An even worse case: since this is undefined behavior, the compiler is by no means required to generate deterministic code. Check out this example with clang for x86_64 https://godbolt.org/z/EbTGWMx93. The calling convention here is that the `esi` register must be set with the value to print. Since I... (more) |
— | over 3 years ago |
Edit | Post #285234 |
Post edited: |
— | over 3 years ago |
Edit | Post #285234 |
Post edited: |
— | over 3 years ago |
Edit | Post #285234 | Initial revision | — | over 3 years ago |
Answer | — |
A: Behavior of Pointer Arithmetic on the Stack Generally speaking, pointer arithmetic is undefined behavior unless carried out on arrays. This is how the additive operators behave, C17 6.5.6: > For the purposes of these operators, a pointer to an object that is not an element of an array behaves the same as a pointer to the first element of a... (more) |
— | over 3 years ago |
Edit | Post #285218 | Question closed | — | over 3 years ago |
Comment | Post #285218 |
I started to write a pseudo-code answer but the question is simply too broad. You need to use `strstr`, you need to use `strcpy`, you need to write a loop. Explaining how to do these things in detail is the task of the string handling chapter in your C book. I voted to close it as "too generic", plea... (more) |
— | over 3 years ago |
Comment | Post #285169 |
@#53410 It's not trivial to get 100k+ rep and a C gold badge at SO. Also it's people I've interacted with for many years and I know how good they are at C programming. Unlike random people in the average open-source project, who tend to range between mediocre and average. As for "wildly used", that c... (more) |
— | over 3 years ago |
Comment | Post #285169 |
@#53410 You aren't going to prove anything by linking random open source libraries by random people - only by providing the take from well-known C gurus. Now as it happens on SO we have some 20-30 of such very skilled C programmers pretty much unanimously agreeing that hiding pointers behind typedefs... (more) |
— | over 3 years ago |
Comment | Post #285169 |
@#53410 I'd say that the vast majority of C programmers find it bad practice. You can for example check out all the close to unanimous criticism regarding how bad the Windows API type system was designed, where the main arguments against it was its use of "Hungarian notation" and pointers hidden behi... (more) |
— | over 3 years ago |
Comment | Post #285169 |
Hiding pointers behind typedef is considered very bad practice. If you got that from a book, it's not a good book. The actual parameters here are `struct listNode **sPtr` which explains why the pointed-at address can be modified - to for example point at space obtained by a `malloc` call inside the f... (more) |
— | over 3 years ago |
Comment | Post #285177 |
Please edit the post and fix the code formatting - you have non-existent indention. (more) |
— | over 3 years ago |
Comment | Post #285148 |
Unless the strings contain any exotic characters beyond Latin English (7 bit ASCII), just type it as you would in any text editor. (more) |
— | over 3 years ago |
Comment | Post #285136 |
@#54710 Some versions of Codeblocks include old gcc/mingw versions before version 5.0.0. Those default to gnu90 and not to a modern C standard - they would exhibit this very bug about missing include that I mention. If you follow the advise in the link I gave, you should be able to use fairly old gcc... (more) |
— | over 3 years ago |
Edit | Post #285135 |
Post edited: More relevant tags |
— | over 3 years ago |
Edit | Post #285136 | Initial revision | — | over 3 years ago |
Answer | — |
A: Why does fopen return NULL? - The simple explanation would be that you simply don't have write access to the path, which is one possibility. - Another weird phenomenon that may happen is that you are running a very old C compiler and it can't find `fopen` - because you did forget to `#include `. When this happens on mo... (more) |
— | over 3 years ago |
Edit | Post #285120 | Initial revision | — | over 3 years ago |
Answer | — |
A: What does the greater than 0 indicate in the case of this statement 'if (compare(A[j], A[j+1]) > 0)' ? Thank you. Generally speaking, comparison callback functions in C are often implemented to return an integer lesser than zero, equal to zero or greater than zero - depending on if the first object is lesser than, equal to or greater than the second object. How it is done in your case, there's no telling sinc... (more) |
— | over 3 years ago |
Edit | Post #285051 |
Post edited: |
— | over 3 years ago |
Edit | Post #285051 |
Post edited: |
— | over 3 years ago |
Edit | Post #285051 |
Post edited: |
— | over 3 years ago |
Edit | Post #285051 |
Post edited: |
— | over 3 years ago |
Edit | Post #285051 | Initial revision | — | over 3 years ago |
Answer | — |
A: What does the static keyword do in C? Storage class specifiers `static` is strictly speaking a storage class specifier, which is an attribute given to a variable or a function stating how it is allocated, how it is accessible and how long it will be valid. Other examples of storage class specifiers are `extern` and `register`. It s... (more) |
— | over 3 years ago |
Edit | Post #285050 | Initial revision | — | over 3 years ago |
Question | — |
What does the static keyword do in C? What exactly does the `static` keyword do in C? I have seen it used in several diverse contexts: 1) As a variable outside a function: ```c #include static int x = 5; int main (void) { printf("%d\n", x); } ``` 2) As a variable inside a function: ```c void func (void) { s... (more) |
— | over 3 years ago |
Comment | Post #285035 |
We had this very discussion before here: [Growing software.codidact](https://software.codidact.com/posts/278910). We didn't have the ability to do advertising then though, so maybe it isn't a duplicate. (more) |
— | over 3 years ago |
Edit | Post #284979 | Initial revision | — | over 3 years ago |
Question | — |
Questions easily answered by studying a beginner-level book This scenario is not yet a problem for this site, but we will get there, since it's a huge problem for Stack Overflow: Someone just picks up a well-known programming language for the first time. Then they almost immediately post a question on an online programming forum, which they could have easi... (more) |
— | over 3 years ago |
Comment | Post #284806 |
I know nothing of Python but this sounds like a perfect case for multi-threaded execution in parallel. Split up the 300,000 tasks over a number of threads in charge of calculating their part of the total work. (more) |
— | over 3 years ago |
Comment | Post #284849 |
@#53185 No, but unfortunately some mainstream compilers like the gcc-like ones are not set to strictly conforming C by default. Hence the provided link below bug 1, which instructs how to configure the compiler correctly to prevent the compiler from generating an executable when given non-conforming ... (more) |
— | over 3 years ago |
Edit | Post #284850 |
Post edited: |
— | over 3 years ago |
Edit | Post #284850 | Initial revision | — | over 3 years ago |
Answer | — |
A: Common string handling pitfalls in C programming The reader is assumed to understand how arrays and pointers work in C. You cannot understand pointers before you understand arrays, and you cannot understand strings before you understand pointers and arrays both. Decent C books therefore teaches arrays, then pointers, then strings, in that order... (more) |
— | over 3 years ago |