I`ve been programming in Java, and started learning C++ a few days ago. I was playing around with codes and got this :
# include <iostream>
using namespace std;
int main(){
char str[100];
char *pnt[100];
for(int x = 0; x <= 100; x++){
pnt[x] = str[x];
}
read();
}
void read(){
cout<<"Enter your command :";
cin.get(*pnt, 100);
if(*pnt[0] == 'e' && *pnt[1] == 'c' && *pnt[2] == 'h' && *pnt[3] == 'o'){
for(int i = 4; i <= 100; i++){
cout<<*pnt[1];
}
}else {
cout<<"There is no such command !";
read();
}
}
As I said, I`ve been programming in Java, and I`m totaly new to pointers. I tried everything I had in my mind, I just don`t know what else to do... I appreciate any kind of help, thanks!