If you're making your own class, I suggest you have an array of ints twelve elements big, one for each month. In each of these elements, keep the number of days for the cooresponding month (e.g. daysInMonth[0] = 31 ).
Calculate the number of months difference between the two dates, then have a for loop run through the daysInMonth array, adding to some variable (e.g. totalDays) for each month that's passed. Once the final month is reached, add the number of days (e.g. if you're looking for the 4th, add 4).
I'm over-simplifying, but this should get you started. If using ctime, the dates are kept track of in seconds from some day in the 70s or something. It would be possible to find the days between dates by converting the difference between the two to days instead of seconds or whatever. You'd have to do a tad more research for this option, though.