class string{
private: char *str[MAX]; int count; public: string(){ count=0; } int add(char *s){ if(count<MAX){ str[count]=s; count++; return 1; } return 0; } void disp(){ for(int i=0;i<count;i++){ cout<<str[i]<<" "; } }
}; int main() { string s1; <!-- error occuring in this line. --> s1.add("Sukhvinder"); s1.add("Tarun"); s1.add("Aryan"); s1.add("Hello"); s1.disp(); return 0; }
I am trying to learn the concept of Array of pointers on strings (2-d). Please help me to solve this. Can anyone have a site or channel to learn this concept?
mercredi 2 janvier 2019
reference to ‘string’ is ambiguous
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire