My brain hasn't caught up yet, I'm short a nap...
I've been doing Tests in other language and would love to bring that back to my C. Is there a way to do unit tests, or similar, with C? Any links...
Type: Posts; User: Leam
My brain hasn't caught up yet, I'm short a nap...
I've been doing Tests in other language and would love to bring that back to my C. Is there a way to do unit tests, or similar, with C? Any links...
Thanks! I wasn't sure if there was something else to look at.
Which ones are recommended?
What open source compilers do you recommend for C? I know GCC is the "standard", but clang is one I've heard of. Are there others? Is there a reason to use one or the other?
My goal is to get...
While it's much faster than the combined version I'm still getting 0.023s (awk) vs 0.004s (C). Still, that's good info to pass on, I don't want to misrepresent.
Saw your first note and, with help from Google, came up with:
awk 'BEGIN{for(i=0;i<10000;i++) printf "123rte" > dev/null; }'
Which runs in 0.023 seconds. Comparable to python (0.026s),...
Forgot to mention that the C version takes ~ 0.004 seconds and the awk version takes ~20 seconds.
I was told someone's awk code ran almost as fast as C. Not sure that's close to a true statement even in simple tasks. I wrote two tests and ran them with Linux's time command. Is this a fair and...
Ah, maybe the small size of my tasks hides the problem the include process is trying to solve?
So, here's where I'm playing. The main function is in run_ship.c that calls lib/ship.c.
https://github.com/LeamHall/ale_lcthw/blob/master/leam/run_ship.c#L2
Which includes lib/ship.h which...
Ah...while enlightenment is still far away, perhaps I begin to see. I am a solo newbie on a learner's path, most of my programs are less that two screens of code. Still, trying to learn the right...
I understand putting functions and such into separate files and then including that file. What I don't understand is the logic behind a file with just function declarations, and then a separate file...
Thanks! I've read this a couple times and am letting it sink in. What confused me most was that every time I ran it, pc would end up where ps started. Not something to depend on, but I just assumed...
I'm working through "Understanding and Using C pointers" (Reese). Code from page 22:
#include <stdio.h>
int main(int argc, char * argv[])
{
short s;
short *ps = &s;
char c;
The following code gives the pointer addresses:
#include <stdio.h>
int main(int argc, char *argv[])
{
int ages[] = { 22, 17, 35, 26};
printf("%p ages\n", &ages);
...
That's what I meant; there's an "if it's not K&R it's crap" mentality. I have K&R. I've tried at least twice to learn C from the 2nd edition and I think once from the first. It may be a great book...
Well, I have to admit to some reverse bias. I've chatted with Zed on-line in years past, and read some of his other stuff. While K&R might be closer to the source, dealing with the IRC community's...
Assess. I'm thinking of picking another book, either K&R or "Understanding and Using C pointers". I have this wild fantasy of doing Linux kernel work down the road. Whether I get there before I die...
On-line group, so we're just gonna have to smoke some electrons...
The self-teaching part is that each of us goes through the book on our own. No one standing up in front giving a lecture. From what I understand of learning theory, all good learning is...
A few of us are talking about using Zed Shaw's "Learn C the hard way" to (re-)learn C. The basic goal is to spend 90 days seeing how far you can get. Anyone have words of wisdom on how to keep such a...