-
November 20th, 2012, 07:58 AM
#1
Noob Q 2D array processing
I am unable to check if the character in the 2D array isalpha
here is my code
#include<iostream>
#include<cctype>
#include<cassert>
#include<cstring>
const int maxChar = 20 ;
using namespace std ;
int main()
{
int count = 0 ;
char d[2][20] = { "hi" , "di" } ;
for(int r = 0 ; r < 2 ; r++)
{
cout << "loop1 " ;
for ( int c = 0 ; c != '\0' && c < 20 ; c++)
{
if (isalpha( d[r][c]))
{
cout << d[r][c] ;
}
else
cout << "nooooooo " ;
}
count++ ;
}
cout << "\n count is" << count ;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|