Array not displaying because I no code good

Hi all, after inputting my numbers, I'm trying to display them from my array, 1 line at a time, but it isn't working. I'm getting weird characters instead. How can I fix this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  #include <iostream>
using namespace std;

int main()
{
   char ssid[5];

   for (int x = 0; x < 5; x++)
   {
      cout << "Please enter the SSID: ";
      cin >> ssid;
   }
    
//help here, please 
   for (int i = 0; i < 5; i++)
      cout << ssid[i] << "\n";
}
Take a look at line 11.

You can't cin into an entire array. You need to cin one index at a time. Change to cin >> ssid[i]
Thank you, SO much!
Topic archived. No new replies allowed.