please help me with 'fread' function

Joined
Dec 18, 2007
Messages
1
Reaction score
0
i want to read grey level values of an image in binary form using fread, inorder to implement this i have used double pointer concept for storing two-dimensional array of pixels...when i executed the below statements in 'c' i got the output as "1390null pointer assignment"

fread(&in[0][0], sizeof(unsigned char), 1, fpi);
a = (int)in[0][0];
printf("%d", &a);

here in[0][0] is the first pixel and the grey level value is assigned to an integer 'a'

i did this inorder to debug the program as it was not giving desired output image.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top