IS IT POSSIBLE TO PASS AN ARRAY INTO A FUNCTION AND THEN CALCULATE THE PRIME NUMBERS OUT OF THE LIST?

Recommended Answers

All 2 Replies

yes, AND YOU DON'T HAVE TO SHOUT SO LOUD!

You could handle it some thing like this:

void getPrimesInList( Clist* in, Clist* out )
{
    Node* cur = in->head;
    while( cur )
    {            
        if( isPrime(cur->value) )
            push_backClist( out, cur );
        cur = cur->next;
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.