Need help in creating an object in c++

Write here if you have problems with your C++ source code

Moderator: Board moderators

Post Reply
nano72
New poster
Posts: 10
Joined: Tue Sep 05, 2006 5:25 pm

Need help in creating an object in c++

Post by nano72 »

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.
lnr
Experienced poster
Posts: 142
Joined: Sat Jun 30, 2007 2:52 pm
Location: Dhaka,Bangladesh

Re: Need help in creating an object in c++

Post by lnr »

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;
}
Post Reply

Return to “C++”