VB For Each iteration in C# RRS feed

  • Question

  • User320184449 posted

    Can someone help guide me in the right direction, having trouble figuring out how to convert this. It's saying, "Argument 1 must be passed with the 'ref' keyword" on the char c but when I add "ref" in front of it, I get "Cannot use 'c' as a ref or out value because it is a 'foreach iteration variable'. Not finding anything on Google either so I'm back here. Thanks again in advance!

            string mystring = "";
            foreach (char c in func1(ref myid))
                mystring += func2(c, ref myheight, ref mywidth);
            return mystring;

    Sunday, November 1, 2020 11:14 PM

All replies

  • User320184449 posted

    I just figured it out, but I'm not sure how to delete this post..

    Monday, November 2, 2020 12:44 AM