views:

773

answers:

4

Hello!!

Does anyone knows how can I read a PPM image into an array using C?

Thanks. Best regards.

+1  A: 

C++ routine to read a PPM (color) image from a file.

Lucas McCoy
Sorry about this question (I do not understand nothing about C++), but I can use C++ in C?
rpf
In general, you can't. But if the C++ code uses no C++-only features it's completely valid C code.
Smasher
@Smasher: So basically its C compiled with a C++ compiler?
Lucas McCoy
+1  A: 

I wrote a PPM reader in C a few years ago. You're welcome to nick bits of it if you like.

jrgc
Thaks a lot for your help :D
rpf
A: 

Hello,

I need to read a PPM file and store it in an array written in C. Unfortunately the file that is addressed above is not available, can you please share it again?

Thanks a lot.

mary
What do you want, some PPM samples or the code to read PPM files?
rpf
@mary, you appear to be in an awkward spot having just started here at StackOverflow. The best way to get what you want is to ask your own question rather than trying to resuscitate an old one like this. Make sure you also include a link to this question and explain why it doesn't help, otherwise you'll be flagged as a duplicate.
Mark Ransom
A: 

I actually need to read a ppm file which I have, but coded with C programming. Thanks a lot

Mary