CAS Community   >   Resources   >  

Random News-Feed Generator

Create a random news-feed using C++

Phil Gardner

Created by Phil Gardner
last edited Feb 12 2021 by Phil Gardner

Written in C++ and will compile and run on a Raspberry Pi, Mac or Linux machine.

Use as an example of a different programming language and what a compiler does.

Alternatively, you can copy and paste the code into as a new repl for C++ and then run.

Source code is here…

To get a C++ compiler, try this…

Copy and paste into a text editor, then save as news.cpp (or something similar).

To compile from the command-line:

g++ -o newsfeed news.cpp

Once compiled, here’s how you can run the newly created executable:


Uses arrays of strings and random numbers.

Feedback and Comments

Available when logged in (join via the front page, for free):
  • View 3 comments on this resource.
  • View resource history, links to related resources.
  • Leave feedback for the author(s), or help by editing the resource.

All Rights Reserved © Computing At School 2021
Using the websiteDisclaimer of liabilityCookies policyPrivacy notice