Also, you need to move forward in your histogram so that you don't print the same four entries over and over and over again. If you need to use fwrite, then you should be adding 4 to histogram every...
Type: Posts; User: tabstop
Also, you need to move forward in your histogram so that you don't print the same four entries over and over and over again. If you need to use fwrite, then you should be adding 4 to histogram every...
Okay, so libjpeg is actually needed. In Ubuntu, you can fire up synaptic and get "libjpeg62". (I already have it installed, and I don't remember installing it special, but I guess I must have.)
...
If jpeg.o is the proper o file, then ditch -ljpeg and just put jpeg.o in your final gcc command.
If you want to "cheat", rename your .jpg to something like .txt and then copy it over, then rename it again. (Rename is called "mv" on *nix, but you probably know that.)
Does Lenna.jpg open in, say, Picture Viewer?
And it wouldn't hurt to make sure it's in the same directory as the executable.
So did you read the homework assignment at all?
So did you do the histogram homework that this is based on? If I give you a number, do you know how to figure out which bin it should go in? (And now, if I give you three numbers, do you know which...
But you have three pages of instructions, and I would be willing to bet $x for most any x that all the information you need is in the instructions, if only you were to read them.
If you know what a filename is, and you've been taught about strings, then you're done.
Presumably you know what filenames are. For now you can think of "const char *" as "things in quotes" if you want (but it could also be a char array).
loadJPG("file1", "file2");