#include<stdio.h>
int main(int argc,char *argv[])
{
int i=10;
void *k;
k=&i;
k++;
printf("%p
%p
",&i,k);
return 0;
}
Is ++ a legal operation on void* ? Some books say that it's not
but K & R doesn't say anything regarding void * arithmetic ( pg. 93,103,120,199 of K &R 2/e)
Please clarify.
PS : GCC doesn't complain at least in k++.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…