Tagged Questions
0
votes
2answers
216 views
Need some advice and feedback on my code's design
I am looking for feedback on the design of my program.
I have a shell script call function.sh that defines a lot of helper functions. My intent is to use those bash functions defined in functions.sh ...
3
votes
4answers
1k views
Initializing char array with string
I don't remember how I got to the thread, but I was reading its replies and one of them states that you should never initialize a char[] with a string literal.
My question: Is initializing a ...
0
votes
1answer
112 views
How do I parse a header with two different version [ID3] avoiding code duplication?
I really hope you can give me some interesting viewpoints for my situation, because I am not satisfied with my current approach.
I am writing an MP3 parser, starting with an ID3v2 parser.
Right now ...
4
votes
8answers
640 views
Grading an algorithm: Readability vs. Compactness
Consider the following exam / interview question:
Implement the strcpy() function in C: void strcpy(char *destination, char *source);
The strcpy function copies the C string pointed by source into ...
8
votes
10answers
1k views
Preferring Python over C for Algorithmic Programming
I've been studying a bit of algorithms and have been looking at sites like SPOJ.pl TopCoder etc. I've seen that programmers prefer C or C++ usually for most algorithmic programming contests.
Now ...
1
vote
1answer
156 views
Synchronously write file
I am implementing a server in C for a course project. The server should serve more than one client simultaneously. The description of the project states that fork() should be used to serve more than ...
10
votes
2answers
729 views
Best overview to modern C++ paradigms?
I used to write C++ extensively between 8 and 10 years ago. I have since moved on to C# for professional reasons. However, from time to time I see statements like
"If you're still manually ...
4
votes
6answers
637 views
Why is C++ backward compatibility important / necessary? [closed]
As far as I understand it is a wide-spread opinion within the C++ community that certain features of C++ (including some features inherited directly from C), while still usable in themselves, do not ...
0
votes
4answers
327 views
How does using #define for loop and condition bounds in C increase security?
My program uses the following define statements:
#define LOWEST_PATIENT_ID 10000
#define HIGHEST_PATIENT_ID 99999
#define LOWEST_CRITICAL_STATUS 1
#define HIGHEST_CRITICAL_STATUS 100
used in this ...
19
votes
11answers
2k views
typedefs and #defines
We all have definitely used typedefs and #defines one time or the other. Today while working with them, I started pondering on a thing.
Consider the below 2 situations to use int data type with ...
4
votes
8answers
840 views
Why has the rate of programming language popularization slowed down in recent decades? [closed]
If I understand correctly, there was a huge birth of programming languages during the early decades of computing, but then things have stabilized.
Basically, why are many universities and industries ...
14
votes
10answers
1k views
What are the best practices regarding unsigned ints?
I use unsigned ints everywhere, and I'm not sure if I should. This can be from database primary key id columns to counters, etc. If a number should never be negative, then I will always used an ...
4
votes
1answer
583 views
Coding site with test harness for basic data structures like linked list,graph,strings etc
I just took an Amazon online test and I messed it up badly. I am out of practice and have low confidence in writing code.
Are there any coding sites with test harnesses for basic data structures and ...
0
votes
1answer
226 views
Programmatically create header file
What's the best way to programmatically create a header file for another project?
Here's the specific use case: one program fingerprints the device for discrete information like version number, id ...