傳遞指標引數(函式內部給指標賦值)示例

Lance丶丶發表於2018-03-19
#include <stdio.h>

unsigned char *ptr = NULL;
unsigned char num = 3;

static void fun(unsigned char **mem)
{
    *mem = &num;    
} 

int main()
{
    fun(&ptr);
    printf("%d 
", *ptr);
    
    return 0;
}

相關文章