Char* problem or other issue?


I know this is a very

I have been working on a project for a while and were now cleaning up some unused things, or so I thought.

All of a sudden half of the code stopped working as it should.

In atleast two identified cases char* is involved. Before I got the problem one of them i passed hour, minute or second from an array into a char* variabel in a function but now it dont return any value or a single random charter. This can be found in the minmaxcompare funtion.

In an other the whole code it hangs when I call a function that declars a char* variabe in the arguments.

There are things I am know worked before and I havnt touched them, for examle under void switchoutput(), this set two outputs before but now they dnt seem to work´..

I am not sure where to put the code since I dont know where the issue is ad its almost 55 kb and 6 files o I put it in a rar-file that anyone can download.

Are there any helpful expert out there that might be able to find the issue? I treid a few hurs but are running out of Ideas.

I dont know how to describe the issue so I hop this will do...

Br Erik S

const int maxdisplaynr =10;int displayarray[maxdisplaynr][7][7]; 980 bytes gone - what are you running this on?




And again.

You may want to review all your array subscripts (which start from zero in C)

It's as well we found that, before the sketch grew too big.

Before posting code, please format it, and remove any commented-out sections - if you expect others to read your code, it's only polite not to hurt their eyes.


First of all I am using a mega 2560

Thanks for your input. i was not sure if I should post this big code direcly in the post or not... I had no idea where the problem were so I wanted to post the whole thing.

I tested to remove some of the array definitios and it seems as this setup was causing the problems.

I will rethink how I handle the array, I actually thought I had a clever idea and it wrked until I added a few more rows in that array...

My thought was to have smart setup where i can use a set other variables to get an other.

As I now understand I use data for [0][0] -


if I set [7][7] , is this correct? I think i can change some of the code to start from [0][0] instead of [1][1] that should save some bytes. Or I just have to reduce the nr of "spare" arras I used..

Thank you very much for your help!

/Erik S

For the array declaration you gave, the very last element would have the index [9][6][6]