// filename:c2011-7-29-2-1-ex.c // original examples and/or notes: // (c) ISO/IEC JTC1 SC22 WG14 N1570, April 12, 2011 // C2011 7.29.2.1 The fwprintf function // compile and output mechanism: // (c) Ogawa Kiyoshi, kaizen@gifu-u.ac.jp, December.29, 2013 // compile errors and/or wornings: // (c) Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn) // Target: x86_64-apple-darwin11.4.2 //Thread model: posix // (c) LLVM 2003-2009 University of Illinois at Urbana-Champaign. // Example #include #include #include /* ... */ int main(void) { wchar_t *weekday, *month; // pointers to wide strings int day, hour, min; weekday = L"Monday",month=L"December", day=30, hour=23, min=34; fwprintf(stdout, L"%ls, %ls %d, %.2d:%.2d\n",weekday, month, day, hour, min); fwprintf(stdout, L"pi = %.5f\n", 4 * atan(1.0)); return printf("7.29.2.1 The fwprintf function\n"); } // output may be // Monday, December 30, 23:34 // pi = 3.14159 // 7.29.2.1 The fwprintf function