Hot answers tagged

7 votes

Command line calculator in C

Don't write clever code: if (printf("%g\n", b(&(const char *){*argv}, 0)) < 0) You know you’re brilliant, but maybe you’d like to understand what ...
  • 807
7 votes

Command line calculator in C

General Observations I'm going to address coding style here, since the code is almost unreadable. If you are interested in getting your code reviewed you may want to pay attention to what the ...
  • 21.8k
7 votes
Accepted

Basic recursive descent parser in C

Portable? "I wrote this code with portability in mind," --> Standard C lacks EINVAL. longjmp(jmp, errno = EINVAL); ...
4 votes
Accepted

Command line calculator in C

Avoid global variables for this task The key problem, in this case, is the added difficultly in proving code correctness. Alternative: In func(), instead of ...
1 vote

Breaking a string expression in operator and operands

In Scala strings are sequence of characters; consequently the Iterator methods are available without a previous split. The super type of both String and ...

Only top scored, non community-wiki answers of a minimum length are eligible