main
test-branch
| 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 |
|
|---|
| 8 | void 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.