Not logged in. Log in with GitHub. About Websheets.

List of all available Websheets


Viewing cpp/arrays/arrayprint by dpritcha@usc.edu. You have unsaved changes. Log in above to create, edit, preview and publish Websheets.
PropertyValue
Description
html markup
shown to student
 
Why doesn't this print out the contents of an array?
Public permissions remove
Engine
Template / Reference solution
 
#include <iostream>
#include <string>
using namespace std;
int main() {
   int arr[3];
   arr[0] = 5;
   arr[1] = 10;
   arr[2] = 15;
\[
   for (int i=0; i<3; i++)
      cout << arr[i] << " ";
\show:
  cout << arr;
  return 0;
]\
}
C++ test suite
json list of stdin/args tests
e.g. [{"stdin":"hi", "args":["4", "5"]},
{"stdin":"noargs"}]

to just run once with no input use [{}]
 
[
   {}
]
Solution visibility remove
Add compiler flag(s)
json list of flags
e.g. ["-Wno-unused-variable"]
 
["-Wno-array-bounds"]
remove
Remove default compiler flag(s)
json list of flags
see default_cppflags
e.g. ["-Wno-write-strings"]
 
["-fsanitize=undefined"]
remove


Optional properties:

Note: problems are open-source by default (see 'Public permissions'). Assumed license for open problems is Creative Commons 4.0 Attribution-ShareAlike unless specified in 'Remarks'.