I am sorry if this seems a very simple and obvious question but it caused me a great deal of grief whilst developing a programme.
I am always conscious of trying to use the correct datatype requiring the smallest amount of memory. Recently the programme I was writing required a couple of functions. I got into a mess with zero value results coming out of the Function. I finally discovered that if I had a Single datatype everywhere in the Function it gave the correct answer. If I used an Integer with Singles then it gave a zero answer but there was no warning when I compiled. I finished up making all the datatypes Singles as the function then worked correctly.
This made me wonder what are the rules for datatypes. I am no expert in either C or BASCOM but I believe you can mix datatypes very easily in C. What rules should I adopt for datatypes in BASCOM?
regards Peter
[b:3da3585d4e][color=red:3da3585d4e](BASCOM-AVR version : 2.0.7.2 , Latest : 2.0.7.6 )[/b:3da3585d4e][/color:3da3585d4e]
↧