Skip to main content
10 votes
Accepted

A String View Library in C

Only include the header files that are required: #include <stdbool.h> #include <stddef.h> #include <stdio.h> It is useless to include both ...
Harith's user avatar
  • 5,844
6 votes
Accepted

Command-line parser that takes a command in C

odd semantics I don't understand this: static int is_option(const char *str) { return str[0] == '-'; } That is, if we try ...
J_H's user avatar
  • 25.6k
5 votes

Dimacs parser written in C++

You have already recieved a review for the C++ part, so I'd not repeat that. fseek(file, 0L, SEEK_END); size_t filesize = ftell(file); The ...
Harith's user avatar
  • 5,844
5 votes
Accepted

Dimacs parser written in C++

As others have already mentioned, your implementation is more 'C with std::vectors` than C++. Don't use C headers <cstdio>, ...
Rish's user avatar
  • 2,286
4 votes
Accepted

Linux terminal like parsing

Handle input correctly Your implementation does not handle an empty string correctly (based on the commented out cmd := input[0], which will panic). The input-...
Rish's user avatar
  • 2,286
3 votes

A String View Library in C

The accepted answer has done a fine job of reviewing the posted code. This answer will focus on the macros in this code. In summary: the OP code should remove the ...
ad absurdum's user avatar
2 votes

PowerShell Script for Parsing JSON PyPI Package Data and find the latest version

obtaining minor version ...
J_H's user avatar
  • 25.6k
2 votes

Strings to array

Firstly, I'd suggest separating your tokens from the parser completely. Create a new file, tokens.js and do something like: ...
Lewis Farnworth's user avatar

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