This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #include <stdio.h> | |
// #include <string.h> | |
// #include <stdlib.h> | |
// int i,k; | |
// int *ptr; | |
// int main(){ | |
// while(1){ | |
// scanf("%d", &i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct { | |
volatile *uint8_t** port; | |
uint8_t bit; | |
uint8_t mode; | |
} PortMapType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct StructBits8 { | |
unsigned b0 : 1; | |
unsigned b1 : 1; | |
unsigned b2 : 1; | |
unsigned b3 : 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DDRA |= (1 << DDR2); //DDRA의 2번핀 output | |
DDRA |= (1 << DDR3); //DDRA의 3번핀 output | |
PORTA &= ~(1 << PORT2); // PORTA의 2번 핀 1 출력 | |
PORTA |= (1 << PORT3); // PORTA의 3번 핀 1 출력 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* multi array pointer example */ | |
#include<stdio.h> | |
int main(void) { | |
int a[3][2] = { {1,2},{3,4},{5,6} }; | |
printf("a[0] : %d \n", a[0]); | |
printf("a[0] : %d \n",*(a+0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* multi array pointer example */ | |
#include<stdio.h> | |
void show_data(int(*ptr)[4], int a); | |
int main(void) { | |
int arr1[2][4] = { 1,2,3,4,5,6,7,8, }; | |
int arr2[3][4] = { {1}, {2}, {3} }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* two array pointer example */ | |
#include<stdio.h> | |
int main(void) { | |
int a[3][2] = { 1,2,3,4,5,6 }; | |
printf("a : %d \n", a); | |
printf("a+1 : %d \n", a+1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* two array pointer example */ | |
#include<stdio.h> | |
int main(void) { | |
int a[3][2] = { 1,2,3,4,5,6 }; | |
printf("a[0] : %d \n", a[0]); | |
printf("a[1] : %d \n", a[1]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* double pointer example */ | |
#include<stdio.h> | |
void pswap(int** p1, int** p2); | |
int main(int * pArr, int n) { | |
int A = 10, B = 20; | |
int* pA, *pB; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* double pointer example */ | |
#include<stdio.h> | |
void pswap(int* p1, int* p2); | |
int main(int * pArr, int n) { | |
int A = 10, B = 20; | |
int* pA, *pB; |
NewerOlder