source: CIVL/examples/languageFeatures/printf.cvl@ 44a7259

1.23 2.0 main test-branch
Last change on this file since 44a7259 was 0ea48f2, checked in by Ziqing Luo <ziqing@…>, 12 years ago

fix some bugs in executePrintf in LibstdioExecutor

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

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