Reading Text Files

It contains a program that is given as command parameter the name of a text file, say, temp.dat. It will read each line of temp.dat and print out in correspondence the number of characters and words on that line. At the end it will print out the number of lines that...

Adding Numbers

Read a sequence of positive integers and print them out together with their sum. Use a Sentinel value (say 0) to determine when the sequence has terminated. [sourcecode language=’cpp’] /******************************************************* * MYCPLUS...

Fly away to your vacation

The object of the game is to get to your proper plane on time so you can fly away to your vacation. Of course there a few obstacles and problems along the way and they will be brought up at the appropriate time. It will be up to you to solve the puzzles associated...

Pointer to a Function

An example of using a pointer to a function. It must be pointed out that there is nothing new here, the pointer to a function is available in ANSI-C as well as in C++ and works in the manner described here for both languages. It is not regularly used by most C...

Examples and use of Functions

Examples of function declarations, definitions, and use [sourcecode language=’cpp’] /******************************************************* * MYCPLUS Sample Code – https://www.mycplus.com * * * * This code is made available as a service to our * *...