PROBLEM PASSING ARRAY TO A FUNCTION

I get the following error when i try to pass an array (of char type) to a function
'UNDEFINED SYMBOL (NEAR*,INT) IN MODULE filename.CPP' function definition is 'SHIFT(CHAR XS,INT LEN)' im trying to pass an array containing characters inputed using gets. len contains the length of the array.
the function declaration is 'CHAR SHIFT(CHAR XS,INT LEN)' please help, im a beginner in programing
It's all upper case?
1
2
3
CHAR SHIFT(CHAR XS,INT LEN){
//...
}
closed account (S6k9GNh0)
Would you please post your code and your errors...
If you want to paste your code put it all between this for example:

[code] //paste all of your code between these two box brackets [/code]
In the parameters you have to put empty square brackets to indicate an array. Try this:
1
2
3
char SHIFT(char XS[], int LEN){
...
}
Square brackets are not needed (c++ knows it is an array)... I believe (please correct me if I'm wrong), they are just a notation for the programmer.
Last edited on
eker676: Please refrain from posting anymore. You do not have enough experience with C++ to help others, and for each time you post, it's likely someone else will have to post to correct you.
^ .. :P /snap
char SHIFT(char XS[value], int LEN[value])

{

}

value = 1,2,3,...
Square brackets are necessary for the declaration, so it knows to accept an array, not for the actual passing.

@OP: Please post up your code so we can help.

If I had to take a guess though, I'd say the lack of a space after the comma might be the problem.

(CHAR XS,INT LEN)

should be

(CHAR XS, INT LEN)
@Garandy: Dude, there is no problem with comma thing. @Matt23488's code is correct.
I wasn't pointing to Matt's code, I was pointing to the OP's. Matt's header looks just fine.
Topic archived. No new replies allowed.