source: CIVL/examples/languageFeatures/printf.cvl@ b231753

1.23 2.0 main test-branch
Last change on this file since b231753 was 0293c3b, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

Improved the translation of array literal initializers for pointer type variables.

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

  • Property mode set to 100644
File size: 549 bytes
RevLine 
[fc3ff5e]1#include<stdio.h>
[d828d18]2$input int x;
3$input double y;
4$input char * z;
[85d4675]5
6int main(int argc, char * argv[]){
[d828d18]7 int i = 58;
[85d4675]8 double d = 33.3333333;
9 float f = 33.333;
[21cfdbe]10 char * s = "test%dString";
[4533f7eb]11 double A[2];
[d828d18]12
[0293c3b]13 printf("test0 aabb\r\n");
[d828d18]14 printf("test1 aa\nbb aa\bbb aa\tbb \' \" \n");
[85d4675]15 printf("test2 %d, %o, %x \n", i,i,i);
[d828d18]16 printf("test3 %.16f,%e,%g,%a\n", d,d,d,d);
17 printf("test4 %.8f,%e,%g,%a\n", f,f,f,f);
[0293c3b]18 printf("test5 %d,%s\n", i-20,s);
[d828d18]19 printf("test6 %d,%.16f,%s\n", x,y,z);
[4533f7eb]20 printf("test7 %d\n", &x);
21 printf("test8 %f\n", A[0]);
[85d4675]22}
Note: See TracBrowser for help on using the repository browser.