- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
http://www.psocdeveloper.com/forums/viewtopic.php?f=3&t=11329
Bob
- Labels:
-
PSoC 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assume you need a function to determine if a furnace is hot. You implement the following:
#define TRUE 1
#define FALSE 0
unsigned char isHot()
{
// determine if furnace is hot and return the value
return (TRUE);
// else
return (FALSE);
}
In other functions you have tests like these
if (isHot() == TRUE)
As your project progresses you have lesser program memory and you want to overload your isHot() function to return furnace temperature. Now the function return values are 0 for not hot, and 1 to max for furnace temperature. This is sure to break down your tests. You will have to change them as follows
if (isHot() != FALSE)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems to be applicable -
http://www.geeksforgeeks.org/does-c-support-function-overloading/
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Codeverb is simply an all in one interactive learning portal, we regularly add new topics and keep improving the existing ones
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Welcome here in the Cypress Developer Community.
I cannot see the relation between Cypress and codeverb. When you have any questions regarding PSoCs or other Cypress products do not hesitate to ask them. But it is not a good practice to hijack a three years old thread.
Bob