source: CIVL/examples/languageFeatures/splitFormat.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 585 bytes
Line 
1/* A simple example for conversion specifier.
2 * Format: %[flags][width][.precision][length]specifier
3 * Created by Si Li
4 */
5#include <civlc.cvh>
6#include <stdio.h>
7
8void main() {
9 int a = 1;
10 double b = 2.18162;
11 char c = 's';
12 char *s = "how are you doing";
13 int *p = &a;
14
15 printf("The value of a is %d\n",a);
16 printf("The value of b is %f\n",b);
17 printf("The value of a is %lf\n",b);
18 printf("The value of c is %c\n",c);
19 printf("The value of s is %s\n",s);
20 printf("The value of p is %p\n",*p);
21 printf("The value of b is %03.2Lf\n",b);//with all format parameter
22}
Note: See TracBrowser for help on using the repository browser.