a) f.assign({1,2,3,4,5})
b) f.assign(10,5)
c) both f.assign({1,2,3,4,5}) and f.assign(10,5)
d) f.assign(1,1,1,1)
Meghna MittalBegginer
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
c
Explanation: Both f.assign({1,2,3,4,5}) and f.assign(10,5) are correct way of assigning values to a forward_list. The first assignment initializes the list with the elements 1,2,3,4 and 5 whereas the second assignment initializes the list 10 elements with value 5 i.e. 5 10 times.