Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6252023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:43:14+00:00 2026-05-24T13:43:14+00:00

what is the limit of memory that printf can utilize for storing its computed

  • 0

what is the limit of memory that printf can utilize for storing its computed arguments?
What is the general memory size available for any command (with variable no. of arguments), to store its arguments?

Example code:

#include <stdio.h>

#include <stdlib.h>


int main(int argc, char *argv[])

{

//by default the decimal is considered as double

float a = 0.9;

//long double b = (long double)23455556668989898988988998898999.99 ;

long double b = 5.32e-5;

double  z = 6789999000000.8999;


//b = (long double)1.99999999;

printf("float %f, \n double %lf,\n long double %Lf\n\n\n", b, b, b);

printf("simple:  long double %Lf, double %lf, float %f\n\n\n", b,b,b);

printf(" sumi: float %f, double %lf, long double %Lf\n\n\n", z, z, z);

printf("test2 for le/lg/lf: dbl f %Lf, double g %Lg, double e %Le\n\n\n", b, b, b);  

  system("PAUSE");  

  return 0;

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T13:43:15+00:00Added an answer on May 24, 2026 at 1:43 pm

    The minimum memory requirements for printf to support printing any of the types you can pass to it is about 6k of stack space, assuming 15-bit exponent on long double. For any non-floating-point type, you could get by with 200 bytes or less.

    Of course most real-world implementations are not maximally-efficient here. glibc at least performs malloc as part of printf, at least for some formats, and thus has unpredictable failure cases. As far as I can tell this is just lazy coding… No idea what MS’s printf does but I wouldn’t expect quality code there either…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I configure my C# application to limit its memory consumption to, say, 200MB?
I'd like to limit the size of the file that can be uploaded to
I want to run an executable and limit its memory and time usage. Of
SQL Server express editions have memory limit of 1GB. Can I install multiple versions
I just noticed that I am unable to increase my memory limit above the
In .Net framework 2 GiB is the highest memory that you can allocate for
The current GPU execution and memory models are somehow limited (memory limit, limit of
Is there a way to limit the amount of memory Phusion Passenger uses when
There are limits imposed by available memory, bandwidth, CPU, and of course, the network
I want to limit my users to a directory and its sub directories but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.