<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C printf code not appearing in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258934#M659211</link>
    <description>I have a short test C program that uses several printf commands. When I run the program, there is never any output. Why am I not getting any output from the printf statements and how do I resolve the problem?&lt;BR /&gt;&lt;BR /&gt;The program is below:&lt;BR /&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;STDARG.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;STDARG.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;NETDB.H&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;char user_id[30];&lt;BR /&gt;char password[30];&lt;BR /&gt;char server_name[30]   ;&lt;BR /&gt;&lt;BR /&gt;        strcpy(user_id, "XXX");&lt;BR /&gt;        strcpy(password, "XXX");&lt;BR /&gt;        strcpy(server_name, "XXX");&lt;BR /&gt;&lt;BR /&gt;        printf("user_id %s\n", user_id);&lt;BR /&gt;        printf("password %s\n", password);&lt;BR /&gt;        printf("server_name %s\n", server_name);&lt;BR /&gt;        Return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/NETDB.H&gt;&lt;/SYS&gt;&lt;/STDLIB.H&gt;&lt;/STDARG.H&gt;&lt;/UNISTD.H&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;&lt;/STDARG.H&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
    <pubDate>Thu, 14 Oct 2010 14:31:15 GMT</pubDate>
    <dc:creator>Curtis Deese</dc:creator>
    <dc:date>2010-10-14T14:31:15Z</dc:date>
    <item>
      <title>C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258934#M659211</link>
      <description>I have a short test C program that uses several printf commands. When I run the program, there is never any output. Why am I not getting any output from the printf statements and how do I resolve the problem?&lt;BR /&gt;&lt;BR /&gt;The program is below:&lt;BR /&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;STDARG.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;STDARG.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;NETDB.H&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;char user_id[30];&lt;BR /&gt;char password[30];&lt;BR /&gt;char server_name[30]   ;&lt;BR /&gt;&lt;BR /&gt;        strcpy(user_id, "XXX");&lt;BR /&gt;        strcpy(password, "XXX");&lt;BR /&gt;        strcpy(server_name, "XXX");&lt;BR /&gt;&lt;BR /&gt;        printf("user_id %s\n", user_id);&lt;BR /&gt;        printf("password %s\n", password);&lt;BR /&gt;        printf("server_name %s\n", server_name);&lt;BR /&gt;        Return 0;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/NETDB.H&gt;&lt;/SYS&gt;&lt;/STDLIB.H&gt;&lt;/STDARG.H&gt;&lt;/UNISTD.H&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;&lt;/STDARG.H&gt;&lt;/SYS&gt;&lt;/SYS&gt;</description>
      <pubDate>Thu, 14 Oct 2010 14:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258934#M659211</guid>
      <dc:creator>Curtis Deese</dc:creator>
      <dc:date>2010-10-14T14:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258935#M659212</link>
      <description>If your output is buffered, you may have to call fflush(3) to get the output to come out immediately.&lt;BR /&gt;&lt;BR /&gt;Other than the typo for "Return" and the lack of int for main, the program seems fine.&lt;BR /&gt;&lt;BR /&gt;What HP-UX version are you using?  What architecture?  What compiler version?&lt;BR /&gt;Still Integrity 11.31?</description>
      <pubDate>Thu, 14 Oct 2010 14:52:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258935#M659212</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-14T14:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258936#M659213</link>
      <description>I am using HP-UX 11.31 Integrity. I do not know the compiler version, but I am using cc. The file is a ProC file (test.pc)&lt;BR /&gt;&lt;BR /&gt;Here is the Makefile I am using:&lt;BR /&gt;&lt;BR /&gt;include /u01/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk&lt;BR /&gt;&lt;BR /&gt;CFLAGS=-D_USE_BIG_FDS -Ae -DHPUX -DORAIA64 -DHPUX_IA64 +DD64 -DSS_64B \&lt;BR /&gt;-IT_SERVER -DHPPA64 -DSLS8NATIVE -DSLU8NATIVE +DD64 -DSS_64BIT_SERVER&lt;BR /&gt;&lt;BR /&gt;all:    test&lt;BR /&gt;&lt;BR /&gt;test: test.o&lt;BR /&gt;        $(CC) -o test test.o -L $(LIBHOME) $(PROLDLIBS)&lt;BR /&gt;&lt;BR /&gt;test.o: test.c&lt;BR /&gt;        $(CC) $(CFLAGS) $(PRECOMPPUBLIC) -c test.c&lt;BR /&gt;&lt;BR /&gt;test.c: test.pc&lt;BR /&gt;        $(PROC) $(PROCPLSFLAGS) iname=test.pc&lt;BR /&gt;&lt;BR /&gt;clean:&lt;BR /&gt;        rm -f test.o testlog.o test.c&lt;BR /&gt;&lt;BR /&gt;cleanall: clean&lt;BR /&gt;        rm -f test</description>
      <pubDate>Thu, 14 Oct 2010 15:22:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258936#M659213</guid>
      <dc:creator>Curtis Deese</dc:creator>
      <dc:date>2010-10-14T15:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258937#M659214</link>
      <description>&lt;!--!*#--&gt;&amp;gt; The program is below:&lt;BR /&gt;&amp;gt; [...]&lt;BR /&gt;&lt;BR /&gt;That's "test.pc"?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] The file is a ProC file (test.pc)&lt;BR /&gt;&lt;BR /&gt;"The file" is the same as "The program"?&lt;BR /&gt;&lt;BR /&gt;Some of us lack Oracle, making it tough to&lt;BR /&gt;see what's happening here.  Care to exhibit&lt;BR /&gt;"test.c"?  (Have _you_ looked at it?)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] I do not know the compiler version,&lt;BR /&gt;&amp;gt; but I am using cc. [...]&lt;BR /&gt;&lt;BR /&gt;      uname -a&lt;BR /&gt;      cc -V&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] $(LIBHOME) $(PROLDLIBS)&lt;BR /&gt;&lt;BR /&gt;&amp;gt; [...] $(PRECOMPPUBLIC) [...]&lt;BR /&gt;&lt;BR /&gt;Can't see those macros from here, either.</description>
      <pubDate>Thu, 14 Oct 2010 23:50:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258937#M659214</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-10-14T23:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258938#M659215</link>
      <description>KISS.&lt;BR /&gt;&lt;BR /&gt;Reduce, try, expand, retry.&lt;BR /&gt;You might be building/running the wrong thing.&lt;BR /&gt;&lt;BR /&gt;Try this.... just feed it into cc and execute a.out&lt;BR /&gt;--- &lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;char user_id[30];&lt;BR /&gt;&lt;BR /&gt;strcpy(user_id, "XXX");&lt;BR /&gt;&lt;BR /&gt;printf("user_id %s\n", user_id);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;That works right?&lt;BR /&gt;Now feed it to pro*c, then cc. ... still works?&lt;BR /&gt;Add some switches... still works?&lt;BR /&gt;Use the make file. &lt;BR /&gt;Check with ls -ltr test.*&lt;BR /&gt;Every thing in 'order' and  build as expected?&lt;BR /&gt;&lt;BR /&gt;Good luck!&lt;BR /&gt;&lt;BR /&gt;btw... what is 'Return' ? typo?&lt;BR /&gt;&lt;/STRING.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Fri, 15 Oct 2010 01:27:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258938#M659215</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2010-10-15T01:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258939#M659216</link>
      <description>As Steven said, what's in test.c?  Does ProC somehow remove your printf calls?</description>
      <pubDate>Fri, 15 Oct 2010 02:39:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258939#M659216</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2010-10-15T02:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258940#M659217</link>
      <description>I will assume that the program compiles and you called the executable 'test'. You are trying to execute the program by typing 'test' from a bourne or ksh shell.  If you execute:&lt;BR /&gt;&lt;BR /&gt;type test&lt;BR /&gt;&lt;BR /&gt;it will respond with (at least on my system it does) "test is a shell builtin.". So your program never gets executed.  Try running it with: ./test or call it something else.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 18 Oct 2010 11:07:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258940#M659217</guid>
      <dc:creator>Tom Henning</dc:creator>
      <dc:date>2010-10-18T11:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258941#M659218</link>
      <description>./test worked. I don't know what I was thinking naming the program 'test'. Thanks for your help.</description>
      <pubDate>Mon, 18 Oct 2010 11:20:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258941#M659218</guid>
      <dc:creator>Curtis Deese</dc:creator>
      <dc:date>2010-10-18T11:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: C printf code not appearing</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258942#M659219</link>
      <description>&lt;!--!*#--&gt;&amp;gt; ./test worked. [...]&lt;BR /&gt;&lt;BR /&gt;One of the advantages to showing actual&lt;BR /&gt;commands with their actual output is that&lt;BR /&gt;other people can see your actual mistakes.&lt;BR /&gt;If all you say is that you ran your program,&lt;BR /&gt;then many people will assume that you&lt;BR /&gt;actually did what you said that you did.&lt;BR /&gt;This may force you to wait for someone to&lt;BR /&gt;guess what you did (wrong), which is often&lt;BR /&gt;not the fastest path to the answer.</description>
      <pubDate>Mon, 18 Oct 2010 17:18:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/c-printf-code-not-appearing/m-p/5258942#M659219</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-10-18T17:18:07Z</dc:date>
    </item>
  </channel>
</rss>

