#define BUFF_SIZE 100000
unsigned char buffer[BUFF_SIZE];
void myfunc(unsigned char[],int,int);
void myfuncinfunc(unsigned char[],int,int);
int main()
{
int a = 10, b = 10;
myfunc(buffer,a,b);
}
void myfunc(unsigned char array[],int a,int b)
{
int m,n;
//blah blah
myfuncinfunc(array,m,n);
}
void myfuncinfunc(unsigned char array[],int a, int b)
{
//blah blah
}
我想知道以下内容:
我创建了一个静态数组,如“main”函数上方所示。这有效率吗?如果我使用点和 malloc 代替会更好吗?
我知道它不使用堆栈,所以当我将数组传递给内部函数时,它会创建整个数组的副本还是只发送第一个条目的位置?
在函数“myfunc”中处理“数组”时,我是直接使用静态定义的数组还是一些本地副本?
在函数“myfunc”中,当我们将数组传递给函数“myfuncinfunc”时,是否会再次将第一个位置或数组的完整副本发送到堆栈中?
感谢您阅读这个问题,并非常感谢任何帮助!我是 C 的新手,并试图从互联网上学习它。