I do have a Stack and a List. I need to copy all the items from list to stack without using loops i.e for, foreach.. etc.
Is there recommended way of doing it?
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.
You can create a stack from anything that is IEnumerable
See MSDN: http://msdn.microsoft.com/en-us/library/76atxd68.aspx
However, the stack constructor will be using a loop internally, you just don’t see it.