P
PengYu.UT
Hi,
I have the following two functions. However, the function printa gives
me a warning. If I delete "const" from its definition, I will not get
the warning. I'm wondering if there is anything wrong with compiler,
because the function printb works fine.
Best wishes,
Peng
#include <stdio.h>
void printa(const double (*a)[2]){//warning
//void printa(double (*a)[2]){//no warning
printf("Hello!\n");
}
void printb(const double *b){
printf("Hello!\n");
}
int main(int argc, char *argv[]){
double a[10][2];
double b[10];
printa(a);
printb(b);
return 0;
}
I have the following two functions. However, the function printa gives
me a warning. If I delete "const" from its definition, I will not get
the warning. I'm wondering if there is anything wrong with compiler,
because the function printb works fine.
Best wishes,
Peng
#include <stdio.h>
void printa(const double (*a)[2]){//warning
//void printa(double (*a)[2]){//no warning
printf("Hello!\n");
}
void printb(const double *b){
printf("Hello!\n");
}
int main(int argc, char *argv[]){
double a[10][2];
double b[10];
printa(a);
printb(b);
return 0;
}