1. Define the function
u8 CAN1_Send_Msg(u8 *msg)
{
u8 b[4];
for(i=0;i<4;i++)
b[i] = msg[i];
return 0;
}
2. Function call
u8 current_msg[4] = {
‘1’,‘2’,‘3’,“4”};
CAN1_Send_Msg(current_msg);
First of all, let’s see that current_msg is the array name, so current_msg is equivalent to ¤t_msg[0].
For the defined function, we are equivalent to replacing msg with current_msg.
So that means *current_msg[i] is of type int. msg[i] is equivalent to current_msg[i].
The result of execution is b[0]='1', b[1]='2', b[2]='3', b[3]='4'.