Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to fast read excel file, with VC2005 Pin
Jochen Arndt18-Mar-15 4:02
professionalJochen Arndt18-Mar-15 4:02 
GeneralRe: How to fast read excel file, with VC2005 Pin
lichengbyd18-Mar-15 4:30
lichengbyd18-Mar-15 4:30 
QuestionWriting Vector object into a .txt file Pin
Member 935023718-Mar-15 0:16
Member 935023718-Mar-15 0:16 
AnswerRe: Writing Vector object into a .txt file Pin
Jochen Arndt18-Mar-15 0:46
professionalJochen Arndt18-Mar-15 0:46 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023718-Mar-15 1:38
Member 935023718-Mar-15 1:38 
AnswerRe: Writing Vector object into a .txt file Pin
Jochen Arndt18-Mar-15 1:59
professionalJochen Arndt18-Mar-15 1:59 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023718-Mar-15 5:03
Member 935023718-Mar-15 5:03 
AnswerRe: Writing Vector object into a .txt file Pin
Jochen Arndt18-Mar-15 5:19
professionalJochen Arndt18-Mar-15 5:19 
You can use the printf format specifiers (see http://www.cplusplus.com/reference/cstdio/printf/[^]).

Using the width specifier, all numbers will have the same width padded with blanks. For proper alignment of the decimal point you should also use the precision specifier and the flag specifier (use a space or minus). The final values to be used depend on the range of your values and the required precision. Assuming a range up to (but excluding) 100 and a precision of 2 fractional digits:
Precision = 2
Width = 1 (sign) + 2 (digits) + 1 (decimal point) + 2 (digits) = 6

Then use the format "% 6.2f" for each value:
fprintf(pFile, "% 6.2f % 6.2f % 6.2f\r\n% 6.2f % 6.2f % 6.2f\r\n", 
    newForce.x, newForce.y, newForce.z, newForce1.x, newForce1.y, newForce1.z);


For the time stamp you can use the strftime()[^] function.

modified 18-Mar-15 13:08pm.

GeneralRe: Writing Vector object into a .txt file Pin
Member 935023718-Mar-15 6:33
Member 935023718-Mar-15 6:33 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt18-Mar-15 6:59
professionalJochen Arndt18-Mar-15 6:59 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023718-Mar-15 22:32
Member 935023718-Mar-15 22:32 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt18-Mar-15 22:44
professionalJochen Arndt18-Mar-15 22:44 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023719-Mar-15 22:27
Member 935023719-Mar-15 22:27 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt19-Mar-15 22:29
professionalJochen Arndt19-Mar-15 22:29 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023723-Mar-15 5:12
Member 935023723-Mar-15 5:12 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt23-Mar-15 5:57
professionalJochen Arndt23-Mar-15 5:57 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023723-Mar-15 6:20
Member 935023723-Mar-15 6:20 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt23-Mar-15 6:44
professionalJochen Arndt23-Mar-15 6:44 
GeneralRe: Writing Vector object into a .txt file Pin
Richard Andrew x6423-Mar-15 8:39
professionalRichard Andrew x6423-Mar-15 8:39 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt23-Mar-15 21:53
professionalJochen Arndt23-Mar-15 21:53 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023723-Mar-15 23:47
Member 935023723-Mar-15 23:47 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt24-Mar-15 0:17
professionalJochen Arndt24-Mar-15 0:17 
GeneralRe: Writing Vector object into a .txt file Pin
Member 935023725-Mar-15 4:25
Member 935023725-Mar-15 4:25 
GeneralRe: Writing Vector object into a .txt file Pin
Jochen Arndt25-Mar-15 4:46
professionalJochen Arndt25-Mar-15 4:46 
GeneralMessage Closed Pin
25-Mar-15 6:47
Member 935023725-Mar-15 6:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.