I got it working , can someone please delete my attached files to avoid plagiarism
I got it working , can someone please delete my attached files to avoid plagiarism
Last edited by ICool; 10-22-2007 at 12:07 AM.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
................. working
Last edited by ICool; 10-22-2007 at 12:26 AM.
Vista like to spring this kinda stuff on me all the time :'(it says permission denied
If these are just warnings maybe I can still run it ?
Please help , I have no idea how to get it working .....
This looks odd to me, and apparently your compiler too. I don't have your header.Code:int (*Image_invert(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]))[]
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Header ? Do you mind checking the Image.c file , I' m not able to post the contents now , the network is clogged up at uni , and I can't even get terminal to open .
Last edited by ICool; 10-21-2007 at 09:29 PM.
Without it, my compiler complains differently.Code:#include "ep100lib.h"
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
The header is present in both Image.c and the Image_lib.c ??
To you.
If you are asking folks here to make stuff up and guess how to help, it makes for a long and difficult journey.
Then again, I'm off my game again lately.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*
Uhm I just don't know how to solve my errors . I gave you all the information I can .
Image.c contains this line
#include "Image_lib.c"
It should be written as
#include "Image_lib.h"
Where Image_lib.h is a new file containing
Image_lib.c should also include this file as well.Code:#ifndef IMAGE_LIB_INCLUDED #define IMAGE_LIB_INCLUDED #define EP100_LIB_MAX_X 1024 #define EP100_LIB_MAX_Y 1024 int (*Image_invert(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y]))[]; // A procedure that will scroll an image horizontally and return back into matrix void Image_horizontal_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width); // A procedure that will scroll an image vertically and return back into matrix void Image_vertical_scroll(int image_data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y], int scroll, int height, int width); #endif
After that, your scroll functions need looking at because I don't think they're returning the modified result.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
The EP100... constants should really come from teh EP100 lib file, if I've understood the other thread.
But the halucinogenic drugs influencing the teacher is springing up again: Apparently, the students have been told to create TWO source files, one main and one which contains the image_invert. So an extra header file is (from what I understand) not allowed... Stupid rules - I can understand rules that say "You can't use this library function, because you should be implementing it yourself". But I don't see the point of teaching really bad habits.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
>I got it working , can someone please delete my attached files to avoid plagiarism
Don't do that, what if someone else has the same or similar problem?
If you want to avoid plagiarism, don't post your code in the first place.