Main Menu

HOME

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

US Job listings




   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
Reverse sort(PHP)
DIsplay the content type with PHP and cURL(PHP)
Cascade windows(VB)
text background colour(CSS)
File size function(PHP)
Previous page(Javascript)
Count the occurences of a SubSTring(VB.net)
Currency convertor(PHP)

    




Copyright © 2003 by programmershelp.co.uk