Passing a value to function

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Pass value as parameter:

   

Hi I have had some trouble regarding passing a value to function as a parameter.

   

This is how I am calling the function.

   

Keypad (&recievedCode);  

   

The *rCode contains zero, even though receivedCode- contains 1234.  

   

 

   

uint8 Keypad (char * rCode [100])

   

{

   

-Something. 

   

}

0 Likes
1 Reply
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When you declared

   

char recievedCode[100];

   

then

   

recievedCode is already a pointer, so you are passing the address of a pointer to KeyPad function.

   

 

   

Bob

0 Likes