assignment discards ‘const’ qualifier from pointer target type的解決

前段時間用C寫一個求和子函數,可是出現assignment discards ‘const’ qualifier from pointer target type的警告。代碼以下: #include <stdio.h> #define N 10 int sum_array(const int a[], int n) { int sum = 0; int* p; for(p = a;p < a+n;
相關文章
相關標籤/搜索