[C] Pass array to another function
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
int happy(char hex[])
{
uint32_t uv=0;
int i=0;
for(i=0;i<3;i++)
{
printf("hex[%d] = 0x%d \n", i,(int)hex[i]);
}
}
int main(void)
{
char hexValue[3] = {0x16,0x17,0x18};
happy(hexValue);
return 0;
}
Reference :
0 意見:
張貼留言