Problem with structs again

Discuss PocketC for CE (including Desktop Edition)

Postby Glasswalker on Tue Jul 29, 2003 5:29 pm

Ok... having an odd issue...

Code that worked perfectly last time I used it.

I compiled it and ran it, it runs fine...

I save file, and close pocketc

then a week later, I open it, and try to compile...

It fails...

I don't understand! :) hehehehe

it is giving me "Missing function body" errors for any function that is declared in the beginning of the file that has a struct passed to it...

This code all worked before... and now with not a single change (I literally have not touched my hpc since I last compiled the code, I compiled, saved, exited, and shut the machine off. did not touch it since)

If I delete the function declaration, it will compile fine, but only if my functions are declared in the right order so that they have been defined before they are called... Which I can't do in this case...

Anyone know anything about this?

(I know it is not a simple typo, I create a blank program with a simple struct and a simple function that just pulls a string from the struct and bumps it on screen, same deal... but if I delete the declaration at the top, it runs fine)

please! need help! :)

Posts: 47
Joined: Wed Mar 21, 2001 12:18 am
Location: Canada

Postby guy on Wed Jul 30, 2003 9:47 am

How do you pass the struct to the function?

You need to pass a reference I think, memory fails me...

struct test {
int a ;
int b ;
} ;

tester(struct test & c) {
c.a = 1 ;
c.b = 2 ;

PocketC CE API interface:
PCForm and CE API forum:
PocketC CE API interface:
PCForm and CE API forum:
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests