M
Matthew Louden
When I pass an array as a function parameter, it yields the following
compile error. Any ideas?? However, if I create a variable that holds an
array, and pass that variable to the function parameter, then it's working
fine. Any ideas?? Thanks!
public static int[] getFreq(string[] s)
{...
}
int[] res = getFreq({"eee", "ewsww"});
WordFreq.cs(7,23): error CS1525: Invalid expression term '{'
WordFreq.cs(7,24): error CS1026: ) expected
WordFreq.cs(7,29): error CS1002: ; expected
WordFreq.cs(7,29): error CS1525: Invalid expression term ','
WordFreq.cs(7,31): error CS1002: ; expected
WordFreq.cs(7,38): error CS1002: ; expected
WordFreq.cs(7,39): error CS1525: Invalid expression term ')'
compile error. Any ideas?? However, if I create a variable that holds an
array, and pass that variable to the function parameter, then it's working
fine. Any ideas?? Thanks!
public static int[] getFreq(string[] s)
{...
}
int[] res = getFreq({"eee", "ewsww"});
WordFreq.cs(7,23): error CS1525: Invalid expression term '{'
WordFreq.cs(7,24): error CS1026: ) expected
WordFreq.cs(7,29): error CS1002: ; expected
WordFreq.cs(7,29): error CS1525: Invalid expression term ','
WordFreq.cs(7,31): error CS1002: ; expected
WordFreq.cs(7,38): error CS1002: ; expected
WordFreq.cs(7,39): error CS1525: Invalid expression term ')'