使用C返回数组
int [] method()
阵列返回函数的编码格式
char *returnArray(char array []){
char returned [10];
//methods to pull values from array, interpret them, and then create new array
return &(returned[0]); //is this correct?}函数调用方
int main(){
int i=0;
char array []={1,0,0,0,0,1,1};
char arrayCount=0;
char* returnedArray = returnArray(&arrayCount); ///is this correct?
for (i=0; i<10;i++)
printf(%d, ",", returnedArray[i]); //is this correctly formatted?}我还没有测试这一点,因为我的C编译器目前还没有工作,但是我想弄清楚这一点。
九州编程
鸿蒙传说