PRINTF not recognized??!

Discuss PocketC for CE (including Desktop Edition)

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

Hello,

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"

main(){
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...

thanx!
Danny
~ aka NEO

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

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

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

Hi,

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:

main()
{
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!

Wolfgang
Composing music on the PocketPC! - http://www.pdamusician.com
wolfgang
 
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 0 guests

cron