공부/C언어
4.[stm32f103][C언어] 포인터 사용하기
유저라인
2017. 12. 8. 15:17
728x90
반응형
1. test.h
#include <stdio.h>
test2(unsigned int *test2);
2. main.c
#include "test.h"
void main(void)
{
unsigned int test=10;
printf("test1=%d\r\n", test);
test2(&test);
printf("test2=%d\r\n",test);
}
3. test2.c
#include "test.h"
test2(unsigned int *test2)
{
unsigned int *test2_ptr;
test2_ptr = test2;
*test2_ptr = 20;
}
4. 결과
728x90
반응형