한 페 ¶
~cpp
void Test(int * Ascores)
{
cout << "in function : ";
cout << sizeof(Ascores) << " " << sizeof(Ascores[0]) << endl;
}
void main()
{
int scores[4]={1,2,3,4};
cout<<"in main : ";
cout << sizeof(scores) << " " << sizeof(scores[0]) << endl;
Test(scores);
}
strlen int 형 하 함 해 .
sizeof(scores) 크 하 함 sizeof(scores) int* 형 크 한.
크 킬 ??
sizeof(scores) 크 하 함 sizeof(scores) int* 형 크 한.
크 킬 ??
.
해 함 ?? ;;
vs 핑하 함 해 해 firend 함 할 ??
해 함 ?? ;;
vs 핑하 함 해 해 firend 함 할 ??
희 ¶
한 하 한 . 함 하 트형 포 함 . 하 함 해 하 . 함 해 . 통 파 하 ? 해 . 태 한 하 하 테트한 .
~cpp
#include<iostream>
using namespace std;
void Test(int *aArray, int aLength)
{
int *copyArray = new int[aLength];// 크
for(int index = 0; index < aLength; index++)
copyArray[index] = aArray[index];//
cout << "in function : ";
cout << sizeof(copyArray[0])*aLength << " " << sizeof(copyArray[0]) << endl;
// 테트 해 !
cout << "\n copyArray : ";//
for(index = 0; index < aLength; index++)
cout << copyArray[index] << " ";
cout << endl;
for(index = 0; index < aLength; index++)//copyArray 0 화
copyArray[index] = 0;
cout << " copyArray : ";
for(index = 0; index < aLength; index++)
cout << copyArray[index] << " ";
cout << endl;
delete []copyArray;// 해 !!!
}
void main()
{
int arrayLength;
int scores[4]={1,2,3,4};
cout<<"in main : ";
cout << sizeof(scores) << " " << sizeof(scores[0]) << endl;
arrayLength = sizeof(scores)/sizeof(scores[0]);
Test(scores, arrayLength);
//!!
cout << "\n함 해 scores 하 .\nscores: ";
for(int index = 0; index < arrayLength; index++)
cout << scores[index] << " ";
cout << endl;
}










