当前位置:网站首页>C interview 24 (pointer) define a double array with 20 elements a

C interview 24 (pointer) define a double array with 20 elements a

2022-07-07 06:25:00 I'm not Xiao Haiwa~~~~

  1. ( The pointer ) Define a containing 20 An element of double Type of the array a, Define a pointer variable ptrDouble Point to the first address of the array , Then assign values to each element of the array through the pointer variable ( Equal to the subscript value times 3.2+1.5). Next, let the pointer point to the array a Of a[10], Find the sum of all the following elements from this element
    requirement :
    Output requirements :1) Output all elements of the array ;2) Output the result obtained above 10 The sum of the elements ;
    Programming requirements : In addition to defining arrays a Outside , Program about arrays a All operations of must pass through pointer variables ptrDouble To achieve .
void ff(int *arr,int len)
{ 
    
    int *ptrDouble=arr
原网站

版权声明
本文为[I'm not Xiao Haiwa~~~~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207070139568034.html