In this task, the job is to create a new empty file called "output.txt" of size 0 bytes and an empty directory called "docs". This should be done twic
Continue ReadingC++: Apply a Callback to an Array
In this task, the goal is to take a combined set of elements and apply a function to each element. C-style Array: #include <iostream> //
Continue ReadingC++: Create a Two-Dimensional Array at Runtime
Get two integers from the user, then create a two-dimensional array where the two dimensions have the sizes given by those numbers, and which can be a
Continue ReadingC++: What are the differences between a pointer variable and a reference variable in C++?
I know references are syntactic sugar, so code is easier to read and write. But what are the differences? Summary from answers and links bel
Continue ReadingC++: Address of a Variable
Get the address Note that void* is a "pure" address which doesn't carry the type information anymore. If you need the type information (e.g. to recov
Continue ReadingC++: Split a string in C++
What’s the most elegant way to split a string in C++? The string can be assumed to be composed of words separated by whitespace. (Note that I’m
Continue ReadingC++: Create an Object at a Given Address
In systems programing it is sometimes required to place language objects at specific memory locations, like I/O registers, hardware interrupt vectors
Continue ReadingC++: Draw a Clock
Task: draw a clock. More specific: Draw a time keeping device. It can be a stopwatch, hourglass, sundial, a mouth counting "one thousand an
Continue ReadingC++: Constrained Random Points on a Circle
Generate 100 <x,y> coordinate pairs such that x and y are integers sampled from the uniform distribution with the condition that . Then display/
Continue ReadingC++: Flatten a List
Write a function to flatten the nesting in an arbitrary list of values. Your program should work on the equivalent of this list: [[1], 2, [[3,4], 5
Continue Reading