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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/14/08 12:13
Read: times


 
#159040 - How many bytes will be written ??
Maybe a simple query for most of you...

I have a printf() as below : ( sorry its a bit long one ;-)

printf("%02.2d/%02.2d/%02.2d %02.2d:%02.2d:%02.2d\t%04ld\t%04ld\t%04ld\t%04ld\t%04ld\r\n",RTCmonth[x],RTCday[x],RTCyear[x],RTChr[x],RTCmin[x],RTCsec[x],Temp[x],Humi[x],V1[x],V2[x],VBat[x]);

And following are the data types :
int8 RTCmonth[DATABUFFER];
int8 RTCday[DATABUFFER];
int8 RTCyear[DATABUFFER];
int8 RTChr[DATABUFFER];
int8 RTCmin[DATABUFFER];
int8 RTCsec[DATABUFFER];
int16 V1[DATABUFFER];
int16 V2[DATABUFFER];
int16 VBat[DATABUFFER];
int16 Temp[DATABUFFER];
int16 Humi[DATABUFFER];

What I need to know is how many bytes will be sent to an UART as a result of the above printf() ? I am writing the data into a USB Flash through a Vinculum chip. Just prior to calling the FileWrite function I need to load the exact number of bytes that will be written.

I am not sure how printf() handles tab instructions ? Right now I have, by trial and error, found out the number of bytes to be 44 and it works.

But any change to the format is a problem unless I know how to calculate the number of bytes.

Thanks

Raghu

List of 17 messages in thread
TopicAuthorDate
How many bytes will be written ??            01/01/70 00:00      
   return value?            01/01/70 00:00      
      OT: That's why you should never use TABs!            01/01/70 00:00      
         go ahead and use tabs            01/01/70 00:00      
            No, don't!            01/01/70 00:00      
            Any programmers editor            01/01/70 00:00      
               insert spaces for TABs            01/01/70 00:00      
      Oh Yes ... the sprintf()...            01/01/70 00:00      
         So here we go            01/01/70 00:00      
            Wrong!            01/01/70 00:00      
               Valid warnings. But...            01/01/70 00:00      
                  No buts!            01/01/70 00:00      
                     maintability and engineering            01/01/70 00:00      
               Not entirely true?            01/01/70 00:00      
                  You are correct            01/01/70 00:00      
                     Good example of counting dangers            01/01/70 00:00      
                        Good interaction.            01/01/70 00:00      

Back to Subject List