int* p = nullptr;
int i = NULL
int i = nullptr; // 오류 발생
int test = 0;
int* p = nullptr;
p = &test;
*p = 100;
int tset1 = *p;
p = &test;
*p = 100;
int tset1 = *p;
int* pInt = nullptr;
char c = 0;
pInt = &c; // 오류
void* pVoid = nullptr;
int i = 0;
short s = 0;
pVoid = &i;
pVoid = &s;
char* pChar = nullptr;
long long* pLL = nullptr;
char c = 0;
char* pChar = &c; // char타입의 주소만 받겠다고 선언해둔것.
int i = 0;
int* pInt = &i;
long long ll = 0;
long long* pLL = ≪
int i = 0;
char* pChar = &i;
char c = 0;
int* pInt = &c;
void* pVoid = nullptr;
pVoid = &c;
pVoid = &i;
pVoid = ≪
char* pChar = nullptr;
int* pInt = nullptr;
long long* pLL = nullptr;
*pChar;
*pInt;
*pLL;
char ca = 255;
char* pC = &ca;
unsigned char* pUC = (unsigned char*)&ca;
int data = *pC;
data = *pUC;
float fTest = 4.f;
int* pData = &fTest;
float fTest = 4.f;
int* pData = (int*)&fTest;
data = *pData;
float fTest = 4.f;
float* pFloat = &fTest;
float f = *pFloat;
void* pVoid = nullptr;
int i = 0;
pVoid = &i; // int i의 주소값을 쳐넣겠다.
//*pVoid; // 오류
#include <iostream>
int main()
{
int test = 0;
int* p = nullptr;
p = &test;
*p = 100;
int test1 = *p;
{
int* pInt = nullptr;
char c = 0;
//pInt = &c;
void* pVoid = nullptr;
int i = 0;
short s = 0;
pVoid = &i;
pVoid = &s;
}
{
char c = 0;
int i = 0;
long long ll = 0;
char* pChar = &c;
int* pInt = &i;
long long* pLL = ≪
void* pVoid = nullptr;
pVoid = &c;
pVoid = &i;
pVoid = ≪
*pChar;
*pInt;
*pLL;
char ca = 255;
char* pC = &ca;
unsigned char* pUC = (unsigned char*)&ca;
int data = *pC;
data = *pUC;
float fTest = 4.f;
int* pData = (int*)&fTest;
data = *pData;
float* pFloat = &fTest;
float f = *pFloat;
}
{
void* pVoid = nullptr;
int i = 0;
pVoid = &i;
// *pVoid;
}
return 0;
}
1차 23.12.08
2차 23.12.11
3차 23.12.12
4차 23.12.14
5차 23.12.17
6차 23.12.25
7차 24.01.01
8차 24.01.23