Formatting very large numbers in C -


I have to output a large number, using the following code, a double exact number:

 < Code> FPrint (Outfile, "% 11.0f% D (G (n))", Factal Not Reverse (Index, FactCount), Fixture Value);  

Now the number becomes so big that it jumps out of the alignment in the list of outputs. Once it gets more than 11 points, the maximum has specified that it continues to grow. Is there any way to deal with it? I'm not sure how big the investment will be on this program.

I think you can not do this straighten you have to print in the string, then the string Will have to change.

  / * pseudo (untrared) code * / value = factorialNotRecursive (index, factCount); / * Ensure that the buff is enough (or if available, use snprintf) * / n = sprintf (buff, "% 11.0f", value); If (n> 11) {Buff [10] = '+'; Buff [11] = 0; } Fprintf (outfile, "% s% d (g (n))", buff, real value);  

Comments