Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

Sedo - Buy and Sell Domain Names and Websites project info: programmershelp.co.uk Statistics for project programmershelp.co.uk etracker® web controlling instead of log file analysis

   Misc

   Amazon

   Links

    


Field width modifiers
 

 

 

Description

This example displays the field width modifiers with the printf function

Code

/*this example displays field width modifiers
with the printf function*/
#include <stdio.h>


main()
{
int sampleint = 974;
/*normal display*/
printf(":%d:\n",sampleint);
/*ten spaces before the integer*/
printf(":%10d:\n",sampleint);
/*ten spaces after the integer*/
printf(":%-10d:\n",sampleint);

return 0;
}

Information

tested with Visual C++ 6

 

 

 

 

Download

fieldwidth.txt


 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
View contents of your inbox(ASP)
Minimize all windows(VB)
common dialog to list box(VB)
source code viewer(C Sharp)
Preload images(Javascript)
Open notepad when a key is pressed(VB)
Using DateDiff(ASP)
File exists(ASP)

    




Copyright © 2003 by programmershelp.co.uk