int main(void)
{
unsigned int Arr[6][2] = {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}};
unsigned int (*pArr)[3] = (unsigned int (*)[3])Arr;
unsigned int index = 0;
unsigned int k = 0;
Software is portable when the cost of porting it to a new platform is significantly less than the cost of writing it from scratch. The lower the cost of porting software, relative to its implementation cost, the more portable it is said to be.
int main(void)
{
unsigned int Arr[6][2] = {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}};
unsigned int (*pArr)[3] = (unsigned int (*)[3])Arr;
unsigned int index = 0;
unsigned int k = 0;
for(index = 0;index < 6;index ++)
{
for(k = 0;k<2;k++)
printf("%d\n",Arr[index][k]);
}
for(index = 0;index < 3;index ++)
{
for(k = 0;k<4;k++)
printf("%d\n",pArr[index][k]);
}
}
输出结果是什么?
软件可移植性代表,代码的架构、处理流程等不因平台的变化而重新编写内容;
比如:
printf(xx,xx,xx,.....);
经过环境配置,该函数针对不同的环境CRT、LCD、串口等,都可以用于输出、显示等内容。