CPP
cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
using namespace std;
//to start type a number to determine how many slots to fill and hit enter.
//type any whole number and enter.
//repeat to fill all slots.
//example: 5
// : 1
// : 2
// : 3
// : 4
// : 5
//on the bottom the values stored in the array are not being printed.
//this has been bugging me for a while.
//can anyone leave a comment to help me change it.
//i want to output the data stored in the array and not the memory location, i guess?
int main(){
int s, x;
cout<<"how many players? ";
cin>>s;
cout<<s<<endl;
//i moved the array from the top to here so a value will be assigned to 's' so the array will have a variable length.
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run