I have almost made this program work except I cannot get the student ID portion to work. I am a very new programmer and I think the logic is good but somewhere I am off on the array for SID.

#include <iostream.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

int main()
char lname[2][50];
char course [7][2][50];
char SID[2][15];
int studentCounter = 0;
int x;
int y = 0;

for (x=0; x<2;x++)
cout<<"Enter name\t";
cin.getline (lname[x],50,'\n');
sprintf(SID[x][15], "%c-%d", lname[x][0],studentCounter);
int y =0;
cout<<"Enter a course\t";
cin.getline (course[y][x],50,'\n');
y++; }
while (y<3);

for (x=0; x<2; x++)
{ cout<<" ID #"<<SID<<endl;
int y = 0;
for (y=0; y<3; y++)
cout<<"\t\t\t\t"<<course[y][x]<<endl; }

return 0;