Page 1 of 1

header files

Posted: Thu Apr 06, 2006 2:33 pm
by Adan_T
Hi everyone,

I'm using the avr gcc compiler. I just found out this compiler does not
include
the cstdio.h header file. Any suggestions as to where to find it?
Thanks

Posted: Thu Apr 06, 2006 3:07 pm
by Raquel
Hi Adan_T,

I have searched for cstdio.h myself and I can't find it. Jon should know where we can get that, I have a feeling though that he created that one himself. But he is not in today, when he shows up tomorrow, I will definitely get him to share you that header file.

Posted: Thu Apr 06, 2006 4:11 pm
by Jon
sorry Adan_T, I did a search for libary's for the functions I was using and I think i made a mistake. I found the atoi() function in the stdlib.h header file. However I think it may be a C++ header file, so it won't work in C. Instead I fixed it so that the converstion is done manuall, by setting an integer to the value of a char and then subtracting 48.

for example:

'0' is an ASCII value of 48
so if you set an integer variable equal to a char variable that contains "0" the integer will become 48, so to convert it to 0 you just subtract 48. (correct me on this if i am wrong)

So you can recheck my code and hopefully it'll run this time, the library's you should need for this code to run will be:
string.h for strlen()
stdio.h for sprintf()

(As well as any other existing libaries that you had included originally to communicate with the display.)