On 1/17/07, Ron <[EMAIL PROTECTED]> wrote:
static TBStructure Fields[40];
..
Fields[j].saveText(frmPtr, dbP);
For some reason certain TBStructure objects in Fields won't call the
saveText function. If anyone could help me I would be very grateful
structures normally dont define functions in C.
your thinking in Java still. an object in C++/Java is effectively a
data structure with a number of associated methods/functions. in
C, data and code tend to be seperate from each other.
data:
TBStructure field;
function:
void saveText(TBStructure, ...)
{
}
you call it via:
saveText(field, ...);
now; if your a C expert; you can define a function pointer within a structure
so that you can do something like this:
field -> saveText()
but, thats way above your head right now. there is nothing wrong with learning
Java at university level - heck, its a great language to learn the
basic fundamentals
of programming. you know how constructs work, how do use arithmetic and
write basic "inline C" code with your java experience.
you need to understand how C manages data and code together - and, for
this i recommend you grab hold of a C programmers book. it will step you
through some of the basics - questions of course are out of scope for
this development forum.
you may even want to consider using C++ instead of C - as, its closer to Java.
a few websites for quick reference:
http://en.wikipedia.org/wiki/C_(programming_language)
http://en.wikipedia.org/wiki/C%2B%2B
thats a starting point for you.
--
// Aaron Ardiri
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/