Please support our IT Professionals' Lounge advertiser: Programming Forums
Views: 28570 | Replies: 8
![]() |
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
Anyone know how I can tell how many days are in each month? A formula would be really nice.
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
Thanks! Now I just need to find some cool things to do with dates!
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
I'm trying to do something that will help me learn a little. I know all the easy stuff but I can't find anything to do with pointers and references. I have add and subtract functions, but none of those require me to use references or points
•
•
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation:
Rep Power: 9
Solved Threads: 18
I don't really care about date/time programming, but I just wanted to start a program that could possibly give me some good experience. I'm most interested in getting more experience with pointers and references, so I thought I could implement something in the date class I was making, but was wrong.
See, the two functions I have return dates, because that seems to be the most sensible approach:
Date Date::add(Date addThis)
{
}
At first I was hoping for a function that used references or pointers, but it would turn out messy, and kind of stupid:
void Date::add(Date addThis, Date &ref)
{
}
The only way I could think of using references was to provide a second paramenter, which seems like a terrible solution.
I hope you see what I'm getting at even though I don't write very clear!
Anyways, I'm reading three different books and got more than enough experience with refs and pointers with in text reading, but I want hands on experience. I just can't seem to find something useful to do. I mean, almost everything I think can be done returning the object rather than using a reference.
Any of that make sense!
See, the two functions I have return dates, because that seems to be the most sensible approach:
Date Date::add(Date addThis)
{
}
At first I was hoping for a function that used references or pointers, but it would turn out messy, and kind of stupid:
void Date::add(Date addThis, Date &ref)
{
}
The only way I could think of using references was to provide a second paramenter, which seems like a terrible solution.
I hope you see what I'm getting at even though I don't write very clear!
Anyways, I'm reading three different books and got more than enough experience with refs and pointers with in text reading, but I want hands on experience. I just can't seem to find something useful to do. I mean, almost everything I think can be done returning the object rather than using a reference.
Any of that make sense!
>I'm most interested in getting more experience with pointers and references
Write a balanced binary search tree. That will give you plenty of experience with pointers. See below for a recommendation to get a handle (pun intended) on references.
>which seems like a terrible solution.
Probably because it is.
>I mean, almost everything I think can be done returning the object rather than using a reference.
Create your own stream. You'll be forced to use references heavily.
Write a balanced binary search tree. That will give you plenty of experience with pointers. See below for a recommendation to get a handle (pun intended) on references.
>which seems like a terrible solution.
Probably because it is.
>I mean, almost everything I think can be done returning the object rather than using a reference.
Create your own stream. You'll be forced to use references heavily.
I'm here to prove you wrong.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode