English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I have a program running for a university project (1st year at uni of central lancashire, preston, england baby yeh...

everything works fine, its a carpet shop program that calcs the prices etc then asks for a delivery date....
which it then converts to three strings, and then to integers for seperate day / month / year (need this as it is,
so dont say i should change it...)

cout << "\nPlease enter the preferred date of delivery, in the format DD/MM/YYYY: \n";
cin >> Date;

DayStr[0] = Date[0];
DayStr[1] = Date[1];
DayStr[2] = '\0';
^^ same for month and years ^^

i then get the date n time from the system using time_t now;


how can i subtract the currrent date from the delivery date so i can print to be delivered in x days?

any help welcomed :D

2006-11-19 04:35:32 · 3 answers · asked by jimmyhigginz 1 in Computers & Internet Programming & Design

3 answers

Assuming your above program works, which I don't think it will because your doing an aggregate operation on an array..you should assign values to indexes in the array...eg cin >> Date[0] or use a for loop or something...regardless since your putting everything in an array anyway simply do something like using a counter variable, personally i think it would be the easiest way of doing something like that.

int counter = 0;

cout << enter day to subtract << endl;
cin >> counter;
cout << Date[1] - Date[counter] << endl;

I belive using

2006-11-20 13:04:10 · answer #1 · answered by D 4 · 0 0

Scheduling in many circumstances comes all the way down to 2 issues: (a million) convenience of physician and (2) gestational age. My OB basically has "surgical treatment days" on a definite day of the week and has holidays scheduled in develop. Then it comes all the way down to gestational age - which i've got confidence they elect to have between 38-40 weeks.

2016-10-22 08:57:48 · answer #2 · answered by ? 4 · 0 0

i don't know

2006-11-19 04:37:15 · answer #3 · answered by US 2 · 0 3

fedest.com, questions and answers