RSS Forums RSS
Please support our C++ advertiser: Programming Forums

Please help me with arrays

Join Date: Jul 2005
Posts: 23
Reputation: angel22 is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
angel22 angel22 is offline Offline
Newbie Poster

Re: Please help me with arrays

  #8  
Jul 28th, 2005
I am trying to work on this problem. I am assuming the word I am going to check is madam, but I am not sure how to compare them because my book says it is not possible to compare character arrays.

Like say word1[10], word2[10], not possible to say
if (word1==word2)

This is what i have now for entering the word and outputing it backwards, but then I am not sure how to compare them.

const int size = 5;
char pal[size];
cout<<"Enter a word:"<<endl;
cin>>pal;

for(int n=size; n>=0; n--)
cout<<pal[n];
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 12:12 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC