I am new to C++ but have many years of programming. All my learning has been very good until I reached pointers. I must admit am struggling to accomplish simple stuff. For example, after failing to store array data into pointers - and then list the pointers, I went basic with below to help me understand. In this, I am aiming to enter a list of names into array pointer (or something like that), then retrieve the list the values from the memory location. a) I am not able to put this to allow request input and store to pointer b) when I loop through a pointer, it only displays the first characters of the names. If someone can help me achieve the above, it will be my BIGGEST breakthrough in pointers.
please help;
CODE
#include "stdafx.h"
#include<iostream>
#include<cstring>
#include<cctype>
using namespace std;
int i=0;
int main(){
char* studentNames[6]={"John Xyy","Hellon Zzz","Wendy Mx","Beth Clerk", "Jane Johnson", "James Kik"};
int iloop = 0;
//loop through and list the Names
for(iloop=0;iloop<6;iloop++){
cout<<"Student :"<<studentNames[iloop]<<" Addr:"<<&studentNames[iloop]<<endl;
}
cout<<endl;
system("pause");
//Now try and list values stored at pointer memory location
int p=0;
for (p=0;p<6;p++){
cout<<*studentNames[p];
}
cout<<endl;
system("pause");
return(0);
}