Passing list reference to other function

Hi all,

int main(){

list<int> list1 = {1, 0, 0, 1};

for (auto& elem : list1)

xor1(1,elem); // Identifier elem is undefined.

How to pass the list1 element to xor1 function.

Thank you!
http://sscce.org/
Your random lines taken from whatever code you have don't tell us the whole story.

If you've got a <20 line test program demonstrating your issue, then post it "as is".
It removes ALL of the guessing on our part, and will get you answers quicker.
Topic archived. No new replies allowed.