Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Per Westermark
01/03/12 02:55
Read: 429 times

#185282 - Care for details
Responding to: ???'s previous message
I would say your programming error is similar to your posting error - lack of care for details.

1) You did post source code. You did not make use of that fancy button "Insert Program Code". So your code isn't indented.

2) You did not specify in your post what works, and what doesn't work. You expect us to just read source code to figure out what could be wrong. You, on the other hand, would not only have access to the source code but also the hardware. We don't even know if your hardware is in working order or not - you just may have correct code but broken hardware...

3) You haven't told us anything about what debugging you have done. You might not realize it. But debugging is a major part of programming. You are not a programmer if you don't also debug.

4) Why do you involve floating point numbers? void int_to_digits(unsigned long number) obviously takes an integer as input. How can there be any floating point values hiding in that integer, that just requires floor() and modf() to extract?

5) What use is it to do the same thing multiple times in a row?
itd_a = itd_b / 10.0;
dig[2] = floor((modf(itd_a,&itd_b)* 10)+0.5);
itd_a = itd_b / 10.0;
dig[1] = floor((modf(itd_a,&itd_b)* 10)+0.5);
itd_a = itd_b / 10.0;

Wouldn't you be quite bored of having itd_a always being itd_b / 10?

6) Missing lots of comments about what you think you are doing - and more specifically "why".

7) Who can love variables named a, b, c, d, e, f - and f being different data type than a..e?


List of 7 messages in thread
frequency counter      Anil Kumar      01/03/12 02:41      
   Care for details      Per Westermark      01/03/12 02:55      
      frequency counter      Anil Kumar      01/03/12 04:28      
         Still not correctly posted code. Still arbitrary floats...      Per Westermark      01/03/12 04:48      
         Check some small things      Maunik Choksi      01/03/12 22:12      
            typical      Erik Malund      01/04/12 07:42      
   what a mess      Erik Malund      01/03/12 03:41      

Back to Subject List