Go Down

Topic: Char* problem or other issue? (Read 507 times) previous topic - next topic


May 18, 2012, 02:04 am Last Edit: May 18, 2012, 02:11 am by FlyHigh-Swe Reason: 1

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...

Erik S


May 18, 2012, 08:32 am Last Edit: May 18, 2012, 09:45 pm by AWOL Reason: 1
Code: [Select]
const int maxdisplaynr =10;
Code: [Select]
int displayarray[maxdisplaynr][7][7]; 980 bytes gone - what are you running this on?

Code: [Select]
Code: [Select]
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.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.


May 18, 2012, 12:44 pm Last Edit: May 18, 2012, 12:48 pm by FlyHigh-Swe Reason: 1

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
Code: [Select]
[0][0]  -
Code: [Select]
if I set
Code: [Select]
[7][7] , is this correct?
I think i can change some of the code to start from
Code: [Select]
[0][0]  instead of
Code: [Select]
[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
Code: [Select]
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131