Sunday, July 12, 2009

Visual C++ compiler problem....?

the program that i wrote (in C++) was supposed to read the pixel intensities from a PGM image and create a negative of this picture (also in PGM format). what i did was that program was reading every pixel and was being subtracted from 255 (since maximum possible intensity was 255 according to hearder information). But, when the negative of the picture was displayed (throughVisual C++ compiler), it was cut in half and sides were switched. But it was perfectly working in PUTTY(another Linux Redhat compiler). if someone can help me with this problem i will really appreciate it..thankyou!

Visual C++ compiler problem....?
I highly doubt this is a compiler problem. For one thing, and I realize this is very hard to guess, a compiler...*compiles* code. Now, I highly doubt the negative of the picture was being displayed through the compiler. Rather, I think you screwed up the code.





Moreover, PUTTY isn't a compiler. It's an SSH client. I'm guessing you sshed to a Redhat box, and used gcc to compile it.





We can't help anymore than this, as we are stuck with "I have bad code" and uh, that isn't a question.
Reply:are the numbers you read from the file of a consistent type betwen the 2 platforms? have you debugged the numbers that you read from the file and checked they are the same across platform? Sorry but i'm just pi$$ing in the wind.


No comments:

Post a Comment