swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: x . huang
Date: Tue, 30 Jun 1998 09:44:50 +0100

new data type ....
Problem: I want to define a new data type (for example, the data type is
a structure), at a global level, such that this type can be used by any 
agents in any swarm. I used tutorial/simpleObserverBug programe to test this
idea. In main.m, I added some codes like:

typedef struct node Node;
typedef Node *PtrNode;
struct node {
int xxx;
float yyy;
PtrNode link;
};

and in ModelSwarm.m, in a method definition (e.g., buildobjects), I try to 
define a temporal variable such as:
Node n1;
PtrNode ptr;

however, when I compiled the newly modified codes, the error message says 
Node and PtrNode has not been declared. 

I am not sure whether this is my C knowledge is wrong (I am a moderate level
C programmer), or Swarm agents does not recognize global data type definition.

Thanks!

Dr. Xueyue Huang
Center for Transport Studies
Imperial College
London SW7

                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]