![]() |
|
#1
|
|||
|
|||
Help with 2D arrays.I'm doing an assignment that has much of the necessary code already given to me, as the professor says the code is far too advanced for the scope of our class (intro to C++) and basically I just have to change things here and there to get it to work the way I need it to.
The assignment is all about 2D arrays-pictures, to be precise. The first task is brightness adjustment. The code given to me changes each value within the 2D array of an image to a higher value. I somehow have to change it so that the amount of change is based on a user input. Any clues as to where I should go to implement a change would be helpful. Here is the code as it is given. CPP / C++ / C Code:
The above code is, like i said, a contrast editor. On top of finding what to change so that the contrast increase/decrease (can go either way by using a + or - number), I have to embed this into an options menu (which utilizes if and else ifs based on option # input), which I have already created. What, if anything, should I leave OUT of the option slot for this particular option and leave at the top by my int main? Can i simply change what I need to change and drop the whole thing into the option slot? I know that ints, floats, etc. can be declared anywhere in the program, assuming that they're declared prior to being used. thanks for reading, and I really appreciate help because I have a hard time tracking down a small bit of what needs to be changed if I don't really know what's going on in the code as a whole. Last edited by LuciWiz : 01-Apr-2009 at 17:24.
Reason: Please insert your C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Help with 2D arrays.Ok, I think I'm getting closer. This is what I have so far. I think it's getting close to letting the compiler run, the only errors I get are [Linker error] undefined reference to `readpic', [Linker error] undefined reference to `addtopixels', and [Linker error] undefined reference to `writeoutpic'. What do I need to fix to make those errors go away?
Only option that is filled with functioning code is option 1. CPP / C++ / C Code:
|
|
#3
|
|||
|
|||
Re: Help with 2D arrays.CPP / C++ / C Code:
As far as your linker errors, it looks like the linker can't find the function implementations. You removed them from the file you were given from your first post. Put them back and then recompile. |
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Help with input files. | Efferus | C++ Forum | 2 | 24-Nov-2007 17:19 |
| Arrays as function arguments - return arrays from functions | pisuke | C Programming Language | 2 | 25-Jul-2007 12:03 |
| Dynamic vs Static Arrays | WaltP | Miscellaneous Programming Forum | 5 | 16-Feb-2006 16:54 |
| I am reviewing Arrays and need help converting some strings to arrays | jenmaz | C Programming Language | 22 | 23-Nov-2004 00:26 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The