[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

array

Posted on 2006-05-12
1
Medium Priority
?
208 Views
Last Modified: 2010-05-18



I need a sample code by take an array of cartype and its number of elements

 and returns the number of cars between the given two years such as

int countCars(cartype * carArray, int arrSize, int year1, int year2)

0
Comment
Question by:mhho
1 Comment
 
LVL 48

Accepted Solution

by:
AlexFM earned 600 total points
ID: 16672953
int countCars(cartype * carArray, int arrSize, int year1, int year2)
{
    int result = 0;

    for ( int i = 0; i < arrSize; i++ )
    {
         if ( carArray[i].year >= year1  &&  carArray[i].year <= year2 )
         {
               result++;
         }
    }

    return result;  
}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ (http://www.experts-exchange.com/viewArticle.jsp?aid=1193) I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question