PRINTF not recognized??!

Discuss PocketC for CE (including Desktop Edition)

Postby dadamse on Wed Jan 31, 2001 5:33 pm


I would like to know why PocketC (Windows CE 2.11, HP Jornada 820) doesn't accept a very simple program like:

#include "/PocketC/pcheader.h"

printf("hello world!\n");

I get the error: "Undeclared identifier (printf)... Do I need another header file or is there a stupid mistake in my script (i don't think so because it works perfectly with a normal C++ compiler for PC...

~ aka NEO

Edited by - dadamse on 01/31/2001 11:38:23

Edited by - dadamse on 01/31/2001 12:29:42
Posts: 1
Joined: Wed Jan 31, 2001 5:30 pm

Postby wolfgang on Thu Feb 01, 2001 1:19 am


the reason is simple: PocketC is a language that is close to C, but it's not real ANSI C. For example, it has a data type "string" for dynamic strings (a nice feature), and many easy-to-use functions for GUI programming, on the other hand it lacks a couple of elements of "regular" C. There are only relatively few of the usual library functions available. There is no printf for example. Have a look at the PocketC documentation on the orbworks site to see what is there and what isn't. To give you some boost, your "Hello World" program in PocketC will look like:

putsl ("hello world!");

No need to include any header files for that, all functions are built into the compiler directly. The PocketC header file contains only some constant definitions for GUI programming.

Hope that gets you going!

Composing music on the PocketPC! -
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests