Ok sorry for the misunderstanding, also thank you very much for helping me I am noob -.- when it comes to programming haha but I am learning slowly
Honestly I'm not for sure even myself what Sequence is..
All I know is I need to declare it some place so I'm going to try to declare it like you said
Code:
unsigned short Sequence();
does that mean I declare it above the other code like this?
Code:
unsigned short Sequence();
std::string PacketBuilder::Get()
{
std::string retdata;
util::pairchar id = PacketProcessor::EPID(this->id);
util::quadchar length = PacketProcessor::ENumber(this->length + 2 + (id[1] != 255));
int extra = (id[1] != 255);
unsigned short sequence = 0;
int bytes_ = 1;
std::string seqdata = "";
if(extra)
{
sequence = Sequence ();
if(sequence >= 253)
bytes_ = 2;
util::quadchar seq_ = PacketProcessor::ENumber(sequence);
if(bytes_ == 1)
{
seqdata += seq_[0];
}
else
{
seqdata += seq_[0];
seqdata += seq_[1];
}
}
util::quadchar length = PacketProcessor::ENumber(this->length + 2 + (extra + bytes_ -1));
retdata += length[0];
retdata += length[1];
retdata += id[0];
retdata += id[1];
retdata += seqdata;
retdata += this->data;
return retdata;
}
Or where should I declare it exactly?
Btw sorry for all the noob questions, hopefully one day I will be better and not have to ask so many questions