Tag Info

New answers tagged

0

There's certainly a case to be made for it. All high-level languages that aren't purely interpreted "compile to another language", and most developers manage to be successful without ever learning (or learning very much of) ASM/CIL/JVM bytecode/whatever else. However, it's important to keep in mind the law of leaky abstractions. When you work on something ...


3

Let me cite from your own question: "… more JavaScript, but I can't find the time or passion …" "I would definitely happily learn fay-lang or purescript …" It seems obvious to me what is the more likely course of action. You obviously don't enjoy JavaScript as much as the other languages you mention. Having fun while learning and feeling ...


1

Valid indices for s are from 0 to lim-1, inclusive, seeing how it is allocated in main as line[MAXLINE]. Also, you have an undeclared (and uninitialized) variable j in getline. I assume it's initialized to 0 because not much else would make sense. When the for loop exits, the maximum value that j can have is lim-2 because we increment it only while ...


1

You should know octal good enough to read (and write) it where neccessary, because there's legacy (and that's the only reason). Also, you absolutely have to know at a glance which base a literal has. Aside from that, the only important bases are 2, 10 and 16. Naturally, you should know all the smaller powers of 2 by heart for easy conversion and ...


3

No. The only remaining widespread use of octal is UNIX permission masks. Having said that, another base isn't particularly difficult conceptually. For the bitmask examples, all you need it a crib sheet with the binary representation of 0-7 then each digit will map to three bits.


-2

I think your understanding of the code is correct (or at least it maches mine). Print a character at a time, unless the last character was white space. But I think both versions suffer from not being clearly stated. I would prefer the below, which is shorter and more explicit. #include <stdio.h> main() { int c, lastC; while ((c = getchar()) != ...


3

It sounds like Zen philosophy but the simple answer is "Be the Computer". Let me tell you a story to explain what I mean... When I was a kid an adult friend/mentor logged me into a mainframe computer at his college to play a text-based game called "StarTrek" using a teletype printer with roll-feed paper (CRT monitors were rare back then). I fell in love ...



Top 50 recent answers are included