OUTPUT???

#include<conio.h>
#include<stdio.h>

int fun(int r,int *ptr) {
printf("%d %d\n",r,r=(char)r);
printf("%d %d",(*(char*)ptr),(*((char*)ptr+1)));
}
void main() {
int r=257;
int *ptr=&r;
clrscr();
fun(r,ptr);
getch();
}
Code with errors can't compile so there's no output. First off, your function fun() is declared as an int but it returns nothing so that an error. If you just want it to print something make it void fun().
okie even if i make it void ...i find that in line 6...ptr+1 will point to what???
because ptr points to variable r in main()..but just cant get what ptr+1 will point to??
Topic archived. No new replies allowed.