30 Aug 2018

Compiling

Instructions

  • Use the http://cpp.sh online tool to run the following code chunks.

  • Discuss what you see with your group members.

  • Please submit your work via submission form (see below).

Chunk 1: Hello World

// This is a comment:
// It's for me, not the computer
#include <iostream>
#include <string>
int main()
{
  // store something
  std::string message = "Hello, world. \n";
  // say the thing
  std::cout << message;
}

Chunk 2: Fixing Things

// This code is broken.
// Please fix it.
#include <iostream>
#include <sting>
int main()
{
  std::string bottle = "A message in a bottle."
  std::cout < bottle;
}

Chunk 3: Your choice

// This code says nothing.
// Please make it say something.
int main()
{
}