Hi

I am trying to create a function in my linked list where I access an element of the list and from this element pull out a certain value from each element. An element looks like the following:

3 1 0 0 0.4 0.5 0 1 1 0 0.3 0.8 0.5 0 0.908333 0.575 0.582261 2 5 4

and I want to access the values 0 and 0.908333 which are entries 13 and 14. The function will then compare the values with other values I bring into the function.

The code I have so far is:

void List::Compare(vector <Vec*> nodeVec){

    for (current = head; current != NULL; current = current->next){

    }
}

which loops through the list.

Please help me!

I might also be approaching the problem in the wrong manner

So if I understand you.

You have a list of nodes, and in each node you have 20-ish variables of data (in an array?)

When you perform the List::Compare function you want it to compare a set of numbers you choose, with every variable of data in every node of your linked list?

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.