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

  • Home
  • SEARCH
  • 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 112859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:36:40+00:00 2026-05-11T02:36:40+00:00

As of now I’m using below line to print with out dot’s fprintf( stdout,

  • 0

As of now I’m using below line to print with out dot’s

fprintf( stdout, '%-40s[%d]', tag, data); 

I’m expecting the output would be something like following,

 Number of cards..................................[500] Fixed prize amount [in whole dollars]............[10] Is this a high winner prize?.....................[yes] 

How to print out dash or dot using fprintf/printf?

  • 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. 2026-05-11T02:36:40+00:00Added an answer on May 11, 2026 at 2:36 am

    A faster approach:

    If the maximum amount of padding that you’ll ever need is known in advance (which is normally the case when you’re formatting a fixed-width table like the one you have), you can use a static ‘padder’ string and just grab a chunk out of it. This will be faster than calling printf or cout in a loop.

    static const char padder[] = '......................'; // Many chars  size_t title_len = strlen(title); size_t pad_amount = sizeof(padder) - 1 - title_len;  printf(title); // Output title  if (pad_amount > 0) {     printf(padder + title_len); // Chop! }  printf('[%d]', data); 

    You could even do it in one statement, with some leap of faith:

    printf('%s%s[%d]', title, padder + strlen(title), data); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer One way is to clear the other user's session cookie.… May 11, 2026 at 12:33 pm
  • added an answer The easiest way is to use System.Xml.XmlDocument or System.Xml.Linq.XDocument to… May 11, 2026 at 12:33 pm
  • added an answer This code works (but not with comment) : { scopeName… May 11, 2026 at 12:33 pm

Related Questions

As of now I'm using below line to print with out dot's fprintf( stdout,
I came across a reference to it recently on proggit and (as of now)
As of the fall of 2008 I'm about to embark on a new development
As of SQL Server 2005, you used to be able to open a flat
The current (as of Dec 2008) iPhone SDK allows me to pick between 3
I'm currently writing a class to handle all database-activity in my application, and so
I just finished a 2d platformer in C++/Allegro. Its still in an incomplete stage...
I have to choose a technology to connect my Application/Presentation Layer (Java Based) with
In order to extend my grep emulator in Perl I have added support for

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.