help me : Error "error: invalid type argument of unary ‘*’ (have ‘int’)"

I try to compile this code in NS2
void AODV::forward(aodv_rt_entry *rt, Packet *p, double delay) {

struct hdr_cmn *ch = HDR_CMN(p);
struct hdr_ip *ih = HDR_IP(p);
double init; int qlen,qlimit;double remain;double T;
if(ih->ttl_ == 0) {

#ifdef DEBUG
fprintf(stderr, "%s: calling drop()\n", __PRETTY_FUNCTION__);
#endif // DEBUG

drop(p, DROP_RTR_TTL);
return;
}

if (ch->ptype() != PT_AODV && ch->direction() == hdr_cmn::UP && ((u_int32_t)ih->daddr() == IP_BROADCAST) || (ih->daddr() == here_.addr_)) {
dmux_->recv(p,0);
return;
}

if (rt) {
assert(rt->rt_flags == RTF_UP);
rt->rt_expire = CURRENT_TIME + ACTIVE_ROUTE_TIMEOUT;
ch->next_hop_ = rt->rt_nexthop;
ch->addr_type() = NS_AF_INET;
ch->direction() = hdr_cmn::DOWN; //important: change the packet's direction
}
else { // if it is a broadcast packet
// assert(ch->ptype() == PT_AODV); // maybe a diff pkt type like gaf
assert(ih->daddr() == (nsaddr_t) IP_BROADCAST);
ch->addr_type() = NS_AF_NONE;
ch->direction() = hdr_cmn::DOWN; //important: change the packet's direction
}

if (ih->daddr() == (nsaddr_t) IP_BROADCAST) {
// If it is a broadcast packet
assert(rt == 0);
if (ch->ptype() == PT_AODV) {
/*
* Jitter the sending of AODV broadcast packets by 10ms
*/
em=node->energy_model(); remain=em->energy();
init=em->initialenergy(); qlen=ifqueue->length();
qlimit=ifqueue->limit();
T=(α*(1-remain/init)+β*(qlen/qlimit))*Tc;
Scheduler::instance().schedule(target_, p,T);
} else {
Scheduler::instance().schedule(target_, p, 0.); // No jitter
}
}
else { // Not a broadcast packet
if(delay > 0.0) {
Scheduler::instance().schedule(target_, p, delay);
}
else {
// Not a broadcast packet, no delay, send immediately
Scheduler::instance().schedule(target_, p, 0.);
}
}

}



but I received :"error: invalid type argument of unary ‘*’ (have ‘int’)".I have no idea what that error means. I am new to pointers and they weren't explained very well in class so I'm not sure that I'm doing this correctly.

I would appreciate any help.
T=(α*(1-remain/init)+β*(qlen/qlimit))*Tc;

You are using non-ascii characters. I'm guessing you copy/pasted that formula from somewhere. You'll need to either rename those vars or replace them with whatever vars you're supposed to be using.
thank you so much !
It replaced alpha and beta to n and m . It done .
Topic archived. No new replies allowed.