writestr2.c

来自「介绍Oracle PL SQL编程」· C语言 代码 · 共 46 行

C
46
字号
/* * writestr2.c * Chapter 12, Oracle10g PL/SQL Programming * by Ron Hardman, Michael McLaughlin and Scott Urman * * This script opens a file and write a single line * of text to the file. It is used in conjunction * with the create_library2.sql script. * * Compilation instructions are below. You need to have * a C compiler installed on your local platform. If * you do not have a C compiler this is not possible. * You do the following: *  - You need to compile this as a shared library in *    UNIX, which has an *.so extension and as a *    Dynamic Link Library (*.DLL) on the Windows *    platforms. *  - On UNIX, there are two different ways to compile *    a shared library. They are noted below for *    reference: *    - Solaris: gcc -G -o sample.so sample.c *    - GNU:     gcc -shared -o sample.so sample.c *  - It is assumed Microsoft's IDE is well designed *    and provides help messages to compile a DLL. *//* Include standard IO. */#include <stdio.h>/* Declare a writestr function. */void writestr2(char *path, int message){  /* Declare a FILE variable. */  FILE *file_name;  /* Open the File. */  file_name = fopen(path,"w");  /* Write to file the message received. */  fprintf(file_name,"%s\n",message);  /* Close the file. */  fclose(file_name);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?