= NULL)
     /* Error */
 if (BIO_set_fp(bio_out, stdout, BIO_NOCLOSE) &lt;= 0)
     /* Error */
 BIO_printf(bio_out, &quot;Hello World\n&quot;);</code></pre>

<p>Write to a file:</p>

<pre><code> BIO *out;

 out = BIO_new_file(&quot;filename.txt&quot;, &quot;w&quot;);
 if (!out)
     /* Error */
 BIO_printf(out, &quot;Hello World\n&quot;);
 BIO_free(out);</code></pre>

<p>Alternative technique:</p>

<pre><code> BIO *out;

 out = BIO_new(BIO_s_file());
 if (out == NULL)
     /* Error */
 if (BIO_write_filen