M
Mikhail Teterin
What's wrong with this program?
#include <stdio.h>
#include <stdlib.h>
static void
meow(const char * const *p)
{
printf("%p\n", p);
}
int
main()
{
char * const *s;
s = malloc(20);
meow(s);
free(s);
}
Why is the call to meow() generate a warning:
t.c:16: warning: passing arg 1 of `meow' from incompatible pointer type
How can the program be corrected without reducing the promise, that meow()
will not modify p[..] AND p[..][..]?
Thanks!
-mi
#include <stdio.h>
#include <stdlib.h>
static void
meow(const char * const *p)
{
printf("%p\n", p);
}
int
main()
{
char * const *s;
s = malloc(20);
meow(s);
free(s);
}
Why is the call to meow() generate a warning:
t.c:16: warning: passing arg 1 of `meow' from incompatible pointer type
How can the program be corrected without reducing the promise, that meow()
will not modify p[..] AND p[..][..]?
Thanks!
-mi