Does anyone know how i could create the following and pass it in to a method to do some analysis [ need to write it in c++ ]
where by it initailises 4 differnt structures
Any ideas how i could go about this ?
at start up time the init object is initilised by passing in the appropriate values to each structure below.
The following structures will have the following types
structure 1 - startDateTime : unix timestamp.
endDateTime : unix timestamp
structure 2 - startDate : unix timestamp.
endDate : unix timestamp.
bandStartTime : offset from 00:00:00 in seconds.
bandEndTime : offset from 00:00:00 in seconds.
structure 3 - startDay : a string (Mon, Tue, Wed, etc).
endDay : a string (Mon, Tue, Wed, etc).
startTime : offset from 00:00:00 in seconds.
endTime : offset from 00:00:00 in seconds.
structure 4 - startDay : a string (Mon, Tue, Wed, etc).
endDay : a string (Mon, Tue, Wed, etc).
startTime : offset from 00:00:00 in seconds.
endTime : offset from 00:00:00 in seconds.
Need help in creating an object in c++
Moderator: Board moderators
Re: Need help in creating an object in c++
Your question is not clear.
What I understood you want to initialize structure element.
If it is then you can use like this..
class abc{
int start;
int end;
};
abc obj[1005];
int main()
{
int temp;
for(int i=1;i<n;i++)
cin>>temp;
obj.start=temp;
cin>>temp;
obj.end=temp;
//processing...........................
return 0;
}
What I understood you want to initialize structure element.
If it is then you can use like this..
class abc{
int start;
int end;
};
abc obj[1005];
int main()
{
int temp;
for(int i=1;i<n;i++)
cin>>temp;
obj.start=temp;
cin>>temp;
obj.end=temp;
//processing...........................
return 0;
}