![]() |
|
#1
|
|||
|
|||
Help finding number of entries in structure arrayHello. I have declared a structure array of a defined structure. Now i want to know how to find the number of entries i have in the array. The array is below.
CPP / C++ / C Code:
I want to know the number of employee entries i have in the array allEmployee[] at any given time. Thank you in advance Last edited by LuciWiz : 03-Nov-2009 at 14:42.
Reason: Please insert your C code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Help finding number of entries in strusture arrayWell, the easy answer is 300.
But, what I'm guessing is that you want to be able to hold a maximum of 300 of them but initially zero. One way to do it is to declare a variable to hold the count. When you decide to add an employee, increment the count. Like: CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: Help finding number of entries in strusture arrayAssuming i use your method to add a certain number of employees. And i want to know now how many employees i have in the array allEmployee[]. How do i do that?
|
|
#4
|
|||
|
|||
Re: Help finding number of entries in strusture arrayQuote:
Every time you add an employee, increment the count like we did in the example: CPP / C++ / C Code:
Maybe I am not understanding your question. Does this make sense? |
|
#5
|
|||
|
|||
Re: Help finding number of entries in strusture arrayA bit embarrassed to say i didn't get what you meant until now.. Thanks a lot
|
|
#6
|
|||
|
|||
Re: Help finding number of entries in strusture arrayQuote:
|
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question about finding numbers in a array are less than a certain number . | allenfanwenyuan | C++ Forum | 5 | 10-May-2007 18:06 |
| Converting a number amount to text | Godzilla | C++ Forum | 5 | 31-Mar-2006 12:38 |
| Need help deleting the last element in the array | headphone69 | C++ Forum | 2 | 15-Mar-2006 20:31 |
| Apache2 config issues | monev | Apache Web Server Forum | 2 | 28-Jun-2004 07:19 |
| Using an array and finding the element number (subscript) | tommy69 | C Programming Language | 27 | 05-Apr-2004 13:23 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The