C++

I've got this code but I'm not sure if its printing out the right code and I'm just curious what it should print out?

#include <stdio.h>
int main(void)
{
int ref[]={8,4,0,2];
int *p;
int index;
for (index=0, p=ref; index<4; index++, p++)
printf("%d %d\n", ref[index], *p);
return 0;
I'm just curious what it should print out

well run the program and your curiosity should be satisfied
gunnerfunner i don't have the program to run it or i would.
i don't have the program

so what's that in the OP?
C++


Misleading title, it's as C as you can get :P

int ref[]={8,4,0,2];


There should be a "}" there instead.
Topic archived. No new replies allowed.