F
Francois Grieu
Is it OK to substract two pointer-to-void ? Are they guaranteed to act
as pointer-to-char ?
I fail to find that discussed in ISO/IEC 9899:1999.
In other words (hopefully), is the following program guaranteed to
output 1?
#include <stdio.h>
int main(void)
{
char t[2] = {'0','1',};
void *p0,*p1;
p0 = &t[0];
p1 = &t[1];
printf("%d\n",(int)(p1-p0));
return 0;
}
TIA,
Francois Grieu
as pointer-to-char ?
I fail to find that discussed in ISO/IEC 9899:1999.
In other words (hopefully), is the following program guaranteed to
output 1?
#include <stdio.h>
int main(void)
{
char t[2] = {'0','1',};
void *p0,*p1;
p0 = &t[0];
p1 = &t[1];
printf("%d\n",(int)(p1-p0));
return 0;
}
TIA,
Francois Grieu