Using .length() with multidimensional char array ? (Help)

Reply

Join Date: May 2004
Posts: 10
Reputation: rodkay is an unknown quantity at this point 
Solved Threads: 0
rodkay rodkay is offline Offline
Newbie Poster

Using .length() with multidimensional char array ? (Help)

 
1
  #1
May 8th, 2004
Hi all,

Quite a basic question for most of you; I am trying to obtain length of a string < char name[MAX_ENTRIES][MAX_NAME_SIZE] > for use in a for loop that will perform isalpha.

for (int j=0; j < &name[i].length(); j++)

I am getting error 2228: left of '.length' must have class/struct/union type upon compile.

Can anyone please offer me some guidance?

This is a simple win32 console application. See attached code.
Attached Files
File Type: cpp code_sample.cpp (473 Bytes, 19 views)
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 34
Reputation: Fili is an unknown quantity at this point 
Solved Threads: 0
Fili's Avatar
Fili Fili is offline Offline
Light Poster

Re: Using .length() with multidimensional char array ? (Help)

 
0
  #2
Jun 19th, 2004
How exactly do you want to get length?!!
The only way I know of is using <string.h> There is a strlen(char *s) function which return the strings length
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC