I have written following programe in c

#include <stdio.h>

char str[]="hello world";
unsigned char hexvalue[] = {0x01,0x02,0x03,0x04,0x05};

int main()
{
    int i;

    printf("string %s \n", str);

    printf("array %x \n", hexvalue); //This line not print whole array why?

    for (i=0;i<sizeof(hexvalue);i++)
    {
        printf ("%x\n",hexvalue[i]);
    }
    return 0;
}

Here both str and hexvalue are pointer then why they both not working same when i am trying to print them?

Related posts

Recent Viewed