#include<iostream> using namespace std; main() { char *p[4] = {"arp","naya","ajin","shub"}; cout<<*p[2]; // How is this printing 'a' // how can i print the elements of each of the 4 strings // except the first character }
Visit http://cpp.sh/7fjbo I'm having a lot of problems in understanding handling of pointers with strings. If you can help with that, please post some additional links. Underastanding the use of arrays with pointers is my primary concern.
charit is printing.."ajin"is exactly that) andchar*. You should use std::string if it's not only for learning purposes.