Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

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
Edit Post #284849 Initial revision over 3 years ago
Question Common string handling pitfalls in C programming
This is a self-answered Q&A meant as a C string handling FAQ. It will ask several questions at once which isn't ideal, but they are all closely related and I'd rather not fragment the post into several. Code written by beginners to C, or found on C programming forums, frequently contains a f...
(more)
over 3 years ago
Edit Post #284571 Initial revision over 3 years ago
Answer A: Are general questions (hopefully resulting in comprehensive, 'canonical' answers) in scope
Generally these questions are fine, though they should come with specific examples, so that they become clearer and can get narrowed-down. I've done a lot of self-answered Q&A here and the hardest part is often to ask a sensible question. - Overly broad questions like "what is OOP?" isn't likely t...
(more)
over 3 years ago
Comment Post #284552 I suspect that what Alexei is trying to create here is a canonical meta post that we can use as reference for all meta questions of the "why did I get a down vote" flavour. Since such meta questions are both tedious and subjective (and cannot really be answered), they could be closed as duplicate to ...
(more)
over 3 years ago
Comment Post #284510 As for the technical content, why would you do this with multiple processes and IPC (pipes) instead of multithreading?
(more)
over 3 years ago
Comment Post #284510 @#53734 There's no beef as such with Stack Overflow, if that's what you refer to (references like "Somewhere Else" etc are mostly tongue-in-cheek). It's perfectly fine to refer to it (and import your content from there to here). Codidact simply strives to be something else: community-driven open-sour...
(more)
over 3 years ago
Edit Post #284481 Post edited:
This is C++ code, not C.
over 3 years ago
Comment Post #284413 This is some random library made by some random person and the link is dead. So unless you have the files on your harddrive, you can't use the lib.
(more)
over 3 years ago
Edit Post #284402 Post edited:
over 3 years ago
Edit Post #284402 Post edited:
over 3 years ago
Edit Post #284402 Post edited:
over 3 years ago
Edit Post #284402 Initial revision over 3 years ago
Answer A: Should we allow questions about installation and configuration of software development tools?
Generally, I would say: On-topic - How to install, configure, trouble-shoot and use tools specifically meant for software development. Compilers, debuggers, IDEs and so on. - Asking questions regarding the above in good faith, as in assuming your problem is related to the specific programmer t...
(more)
over 3 years ago
Comment Post #282566 @#53249 The context of this post is how beginners should compile their programs. They should most definitely not be compiling code that old. In case of professionals, we all have our cross to bear in the form of maintaining old, bade code. I'm still maintaining some (naive) old code written by myself...
(more)
over 3 years ago
Edit Post #284355 Post edited:
Making personal tags which is used by your own code base only has no value to anyone else. If/when your library is used by thousands of people, that's another story...
over 3 years ago
Edit Post #282565 Post edited:
over 3 years ago
Edit Post #284192 Post edited:
over 3 years ago
Edit Post #284192 Initial revision over 3 years ago
Answer A: Is this a good fit for Code Reviews, and if so, how to best post it?
400 lines is not that big, it should be fine to post the complete program below the Code Reviews post category. I'd post it as separate code formatted blocks with one block per file indeed. A reviewer can then fairly easily reproduce the project. Plus then you'll get a review on the overall design...
(more)
over 3 years ago
Comment Post #284178 In the old C language version C90 ("ANSI-C") the rounding direction of division of negative integers wasn't well-defined. So C90 compilers could either round up or down, it's implementation-defined. That is, they didn't necessarily round towards zero but could always round "down", which means that ne...
(more)
over 3 years ago
Edit Post #284085 Post edited:
over 3 years ago
Edit Post #284085 Initial revision over 3 years ago
Answer A: Are there practical reasons for designing a method-only class/object?
Many languages support the concept of functors or function objects which are classes only containing a method/member function. Most notably C++ STL was designed around this - whenever you declare a C++ standard container class object, you have the optional argument defining how that container is s...
(more)
over 3 years ago
Comment Post #284078 @#8049 Aha, in that case ignore my comment. Though in case GPG is an implementation of PGP maybe there should be some tag hierarchy there.
(more)
over 3 years ago
Comment Post #284078 You just invented a tag called GPG? Was that intentional? PGP is some archaic encryption method but I haven't heard of GPG.
(more)
over 3 years ago
Edit Post #283890 Post edited:
over 3 years ago
Edit Post #283890 Initial revision over 3 years ago
Answer A: How to do private encapsulation in C?
The concept you are looking for is referred to as opaque type or opaque pointers. This is the proper method to achieve private encapsulation in C and can also be used for inheritance/polymorphism (which I won't address in this answer). It allows multiple object instances of the same class. Opaque ...
(more)
over 3 years ago
Edit Post #283888 Initial revision over 3 years ago
Question How to do private encapsulation in C?
I'm using an object-oriented design for my C project and trying to implement classes with private encapsulation. How do I do this? Some things I've tried that are problematic: - Using a struct for my class and placing the struct definition in the header file, then designing the API around this and...
(more)
over 3 years ago
Comment Post #283867 @#53919 The programmers who make the compiler port to that specific system sets it up.
(more)
over 3 years ago
Comment Post #277486 @#54212 C (and C++) doesn't have much in the way of program safety. They leave that to the programmer. This is one of the reasons why C is so much faster and suitable for hardware-related programming. More freedom, but more things that can go wrong. You can't really compare it against Java or C# beca...
(more)
over 3 years ago
Edit Post #283868 Post edited:
over 3 years ago
Edit Post #283868 Initial revision over 3 years ago
Answer A: What might happen if I ignore warning?
Warnings most often mean "here is a bug which will likely cause your program to crash or misbehave". They do not mean "here's something that you can optionally fix when you can spare the time". See What must a C compiler do when it finds an error? In your specific case, ignoring the warning leads ...
(more)
over 3 years ago
Edit Post #283867 Initial revision over 3 years ago
Answer A: How allocated memory is calculated?
The size of the "primitive data types" int, float etc is not defined by the standard. In practice, int is either 16 or 32 bits on all known systems. Because of the unspecified size leading to poor portability of the primitive types, the stdint.h library was introduced back in 1999, containing fixe...
(more)
over 3 years ago
Comment Post #283671 When I click on the score button, I explicitly want to sort the answers by score. But it doesn't happen. If this is by design, then why is the button there, since it does nothing?
(more)
over 3 years ago
Edit Post #283667 Initial revision over 3 years ago
Question Sorting answers by score appears to be broken
https://software.codidact.com/posts/277536/278390?sort=score At the point when I'm posting, the answer by Lundin has +14 score and the answer by dmckee‭ has +11 score. Neither has any down votes. Yet when I sort by score, it doesn't show the answer with highest score first. Clicking on "score"...
(more)
over 3 years ago
Edit Post #283441 Post edited:
over 3 years ago
Edit Post #283441 Post edited:
over 3 years ago
Edit Post #283441 Post edited:
over 3 years ago
Edit Post #283441 Initial revision over 3 years ago
Answer A: How to declare variable-length arrays correctly?
C programs are executed from top to bottom. You can't declare a VLA with an uninitialized variable as its size parameter. For the same reason at you can't do this: ```C int x; printf("%d\n",x); scanf("%d",&x); ``` If I type `5` as input to this program, then it doesn't magically go back and...
(more)
over 3 years ago
Edit Post #283440 Initial revision over 3 years ago
Question How to declare variable-length arrays correctly?
This is meant as a FAQ Q&A regarding variable-length arrays (VLA). The two bugs described below are surprisingly common. I'm trying to use the variable-length arrays feature of C99 (and newer) but I'm facing problems with it. - Whenever I write a program like this, I get strange crashes and...
(more)
over 3 years ago
Comment Post #282834 @istiak Inheritance means an "is a" relation. "A dog is an animal". You can't have polymorphism without inheritance. They aren't mutually exclusive or something. Inheritance without polymorphism means that if the MakeNoise function got called as per my example, the function of the base class would be...
(more)
over 3 years ago
Edit Post #282834 Initial revision over 3 years ago