3 Reusable Code Snippet Topics

Remove Filter
Member Avatar for Tom Gunn

CSV is more than just comma delimited fields. There are quoting and white space rules too. This is a short function as an example of a complete way to read CSV records line by line.

Member Avatar for moonlight01
2
370
Member Avatar for Tom Gunn

The forum is buzzing with questions about tokenizing a C++ string. This is a short function that does it and returns a vector of the tokens. As an option, the delimiter string can represent either a multichar delimiter or a collection of single char delimiters: [code] // multichar delimiter == …

Member Avatar for daviddoria
1
734
Member Avatar for Tom Gunn

This is an example of how to turn numbers into words. 1473 would get translated to "one thousand four hundred seventy three", for example. The class has a simple interface and can handle any value representable by unsigned int. The implementation recursively processes groups of 3 digits using table lookups …

Member Avatar for William Hemsworth
3
512

The End.