Show how to get one of your process's environment variables. The available variables vary by system; some of the common ones available on Unix include
Continue ReadingC++: Greyscale Bars
The task is to display a series of vertical greyscale bars (contrast bars) with a sufficient number of bars to span the entire width of the display.
Continue ReadingC++: Loop Continue
Show the following output using one loop. 1, 2, 3, 4, 5 6, 7, 8, 9, 10 Try to achieve the result by forcing the next iteration within the loop up
Continue ReadingC++: Exceptions
This task is to give an example of an exception handling routine and to "throw" a new exception. C++ has no finally construct. Instead you can do t
Continue ReadingC++: Catamorphism
Reduce is a function or method that is used to take the values in an array or a list and apply a function to successive members of the list to produce
Continue ReadingC++: Dijkstra’s Algorithm
Dijkstra's algorithm, conceived by Dutch computer scientist Edsger Dijkstra in 1956 and published in 1959, is a graph search algorithm that solves the
Continue ReadingC++: For Loop
“For” loops are used to make some block of code be iterated a number of times, setting a variable or parameter to a monotonically increasing integ
Continue ReadingC++: Standard Error
A common practice in computing is to send error messages to a different output stream than normal text console messages. The normal messages print
Continue ReadingC++: Call a Foreign-Language Function
Show how a foreign language function can be called from the language. As an example, consider calling functions defined in the C language. Create a
Continue ReadingC++: Identity Matrix
Build an identity matrix of a size known at runtime. An identity matrix is a square matrix, of size n × n, where the diagonal elements are all 1s,
Continue Reading
 
 
 

 
 
				
 
 
 