View Full Version : Can an array be accepted as a parameter for a function?
03-13-2008, 06:51 PM
03-13-2008, 10:08 PM
Not sure about JS, but I know you can do it in C. Too bad you can't use pointers.
03-14-2008, 01:26 AM
03-14-2008, 04:44 AM
You've declared the function function meatandpotatoes(google[i]);twice, and terminated (second time) it with a semi-colon, making the two end }s invalid. It's not required.HandyManOrNot's point is well taken, but it won't throw an error: put all declarations at the top of the code.Some programming style nitpicks:1) most sources will access the content of a text area usingtest = document.codeform.textcode.value; as indocument.formName.boxName.value2) if you want to convert input into an array of separate characters, another way to do it is google = test.split("");in which case you won't need to declare google as an array, and you can find the number of elements n as n = google.length;
vBulletin® v3.7.0, Copyright ©2000-2013, Jelsoft Enterprises Ltd.