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++: Catch an Exception Thrown in a Nested Call
Show how to create a user-defined exception and show how to catch an exception raised from several nested calls away. Create two user-defined exc
Continue ReadingRead/convert an InputStream to a String
If you have java.io.InputStream object, how should you process that object and produce a String? Suppose I have an InputStream that contains te
Continue ReadingC++: Animate a Pendulum
One good way of making an animation is by simulating a physical system and illustrating the variables in that system using a dynamically changing grap
Continue ReadingC++: Count Occurrences of a Substring
The task is to either create a function, or show a built-in function, to count the number of non-overlapping occurrences of a substring inside a strin
Continue ReadingC++: Copy a Range of Elements
On line 7, we create a std::vector<int> called source containing a sequence of values that we wish to copy. On line 9, we have another std::v
Continue ReadingC++: Delete a File
In this task, the job is to delete a file called "input.txt" and delete a directory called "docs". This should be done twice: once "here", i.e. in the
Continue ReadingC++ Full Course Lesson 2: Understanding a Simple C++ Program
https://www.youtube.com/watch?v=SWZfFNyUsxc&index=2&list=PLAE85DE8440AA6B83
Continue ReadingCreating a Memory Leak With Java
I just had an interview, and I was asked to create a memory leak with Java. Needless to say I felt pretty dumb having no clue on how to even start cre
Continue ReadingC++: Greatest Element of a List
Create a function that returns the maximum value in a provided set of values, where the number of values may not be known until runtime. This will
Continue Reading